-1

Given a server or workstation (e.g. windows7, windows server 2008R2) with 2 NICs, can I use it as a simple gateway between 2 LAN segments using only static routes, or do I need to set up additional components (e.g. RRAS in server) to get it to work?

e.g.

given two networks

  • 192.168.100.0/24, outer, connected to the net, default gateway 192.168.100.1
  • 192.168.200.0/24, inner

Server NICs have addresses 192.168.100.2 and 192.168.200.1.

The inner network will then have assigned 192.168.200.1 as default gateway.

1
  • 1
    Yes you can, in a number of ways, but you've not really described the exact requirements you're looking for this isn't really answerable as it stands.
    – Chopper3
    Jun 23, 2013 at 10:52

2 Answers 2

1

Your network setup looks correct.

The crucial point is having IP forwarding turned on.

However it is not clear what you want to do.

If the goal is having Internet access:

Simple routing will not work, NATting will have to be done at some point because the ISP will not route private addresses. (Probably this is done by the ISP's router connected to the 192.168.100.x network. Then that part is ok.)

To merely join the two networks

Essentially you will have the following routes on the router (the machine with the 2 NICs):

  • default GW = internet
  • 192.168.200.0/24 -> 192.168.100.2

I still wouldn't know why you do this. Do you put a firewall somewhere?

1
  • The IP forwarding will probably do the trick. I've never configured anything but dedicated network appliances like this. And yes, for wan access I guess I would need to NAT at some point.
    – grojo
    Jun 24, 2013 at 20:46
3

You also need to confiugre the route back to the internal network.

On your default gateway (192.168.100.1), there is probably a default gateway to the outside world. This gateway also knows the 192.168.100.0/24 network, as it is directly connected.

It does not know the internal 192.168.200.0/24 network, and will use the default route to reach that.

You need to add a static route on 192.168.100.1 as well, telling it the internal network 192.168.200.0/24 is reachable through 192.168.100.2.

In Cisco IOS speak:

ip route 192.168.200.0 255.255.255.0 192.168.100.2
show ip route

In Linux speak:

route add -net 192.168.200.0 netmask 255.255.255.0 gw 192.168.100.2
netstat -rn

In Windows speak:

route add 192.168.200.0 mask 255.255.255.0 192.168.100.2     
route print

Not the answer you're looking for? Browse other questions tagged .