1

I have the following configuration;

Firewall 1 (site 1);

x.x.x.x/26 subnet on external
10.0.0.0/8 on internal (internal IP 10.0.0.10)

Firewall 2 (site 2);

x.x.x.y/26 subnet on external
10.0.0.0/8 on internal (internal IP 10.0.0.20)

Sites are linked by LAN connection, so everything can see everything.

I am looking to configure a linux machine with either 1 or more NICs (VMware) to use a specific gateway for a specific IP address;

10.0.1.1/255.0.0.0 - > 10.0.0.10
10.0.1.2/255.0.0.0 - > 10.0.0.20

Any suggestions would be appreciated.

MichelZ
  • 11,068
  • 4
  • 32
  • 59
user216688
  • 11
  • 1
  • That's fairly easy with policy based routing: http://lartc.org/howto/lartc.rpdb.html – NickW Apr 16 '14 at 14:16
  • 1
    I don't really get the question. A simple route should be enough... – Spack Apr 16 '14 at 14:44
  • @Spack I wish it were that simple as I have tried to add the required entries without success. I may have been adding them in wrong, do you have any information on how this should be formatted I can validate against? – user216688 Apr 16 '14 at 15:47
  • Why don't you post what you've tried? – taddy hoops Apr 16 '14 at 15:56
  • @user216688 I have some difficulties to understand what you mean by internal and external subnets as well as what you really want to achieve. Is there any way you can review the question as it's now very clear. – Spack Apr 16 '14 at 20:06

1 Answers1

1

This is possible with iptables NAT masquerading.

Use two linux machines, on subnet 12.12.12.0/24.

  • ips .10 to .49 routed through 12.12.12.10 (use iptables and nat table masquerade)
  • ips .51 to .89 routed through 12.12.12.50 (use iptables and nat table masquerade)

If you are using dnsmasq, DO NOT activate DHCP.

Danny Staple
  • 1,494
  • 1
  • 9
  • 15
tk samy
  • 11
  • 1