Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
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 '13 at 10:52
add comment

closed as not a real question by Chopper3, growse, Ward, Bryan, Jacob Jun 23 '13 at 18:46

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers

up vote 1 down vote accepted

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?

share|improve this answer
    
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 '13 at 20:46
add comment

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 25.255.255.0 192.168.100.2
route print

HTH

Marcel

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.