Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Just a quick question, how can I create a substitute for a router in a vmware esxi environment containing several windows and linux servers on two seperate subnets?

I would like to use redhat as the server doing the routing between the subnets and I don't want to do any NAT or masquerading.

Thanks, Matt.

share|improve this question
up vote 2 down vote accepted

In the simplest setup, enable IP Forwarding on the redhat machine, configure both ethernet adapters to have IPs on their respective networks. Set the client machines default gateways to point to whichever redhat IP is on the same subnet.

Now if you want this to work with external routers, you'll need to setup some static routes. That can get complicated fast.

share|improve this answer
To enable IP forwarding, set "net.ipv4.ip_forward = 1" in /etc/sysctl.conf and reboot. (Or "echo 1 >> /proc/sys/net/ipv4/ip_forward" – mfarver Nov 10 '10 at 2:28
I've enabled the net.ipv4.ip_forward though I can only seem to ping the ip address of the "router" on the other subnet. No routing appears to be taking place. Is there anything else I'm missing? – Matt Delves Nov 10 '10 at 2:53
iptables is likely on and not allowing you to forward packets from one interface (subnet) to the other interface (subnet). You need to add a FORWARD filter. Have a look at this iptables tutorial:… – gravyface Nov 10 '10 at 3:23
Nope, no iptables enabled. – Matt Delves Nov 10 '10 at 3:24
My apologies. Seems like it is now working to verify the original test. Thanks all. Problem solved. – Matt Delves Nov 10 '10 at 3:56

You could create another virtual switch, assign two virtual interfaces to your RedHat VM and put each on either virtual switch and route accordingly.

share|improve this answer
Yes, that's what I've done. Though how does the "routing accordingly" take place. – Matt Delves Nov 10 '10 at 2:18
You should clarify your question then, but the routing happens as described by mfarver below. – gravyface Nov 10 '10 at 2:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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