-1

Using VMWare Pro, I have two nodes with Centos 7 installed - one connected to my router with two network cards. The other is another node I want to connect to the internet on a different subnet. It looks like this:

192.168.1.1 - internet router
|
192.168.1.108 - (eno16777736) should route to the internet router
192.168.120.131 - (eno33554960) for subnet to pass traffic to 108
|
192.168.120.134 - Node on subnet

Lets call the one with two NICS "Gateway". Currently Gateway has ip forwarding enabled. iptables/firewalld/selinux are disabled currently to troubleshoot why this wasn't routing.

I was able to isolate it to the Gateway:

ping -I eno33554960 returns Destination Host Unreachable whereas ping -I eno16777736 reaches the server since it's on the same subnet as the internet router.

I thought CentOS sets up the route across NICs automatically, but I could be wrong....here's the route table in Gateway:

default via 192.168.1.1 dev eno167777336 proto static metric 100
192.168.1.0/24 dev eno16777736 proto kernel scope link src 192.168.1.108 metric 100
192.168.120.0/24 dev eno33554960 proto kernel scope link src 192.168.120.131 metric 100

I'm also wondering if it could be the VM setup. NIC 1(internet subnet) is setup as Bridged (no replicate) and NIC 2 (the private subnet) is setup as VMNet2(Host-only) which was setup in the Virtual Network Editor. "Connect a host virtual adapter" and "use local dhcp" are checked for this network.

1 Answer 1

0

When you are pinging from the host in the 192.168.120.0/24 network, the internet router needs to know how to send replies back into that subnet, however it probably only knows about the network that it's connected to (192.168.1.0/24) and a default route to the internet.

You will need to either:

  1. Configure a static route on your Internet Router to direct return traffic for the 192.168.120.0/24 network to 192.168.1.108 as the next hop.
  2. Enable NAT on the eno16777736 interface on the "Gateway".

If your Internet Router is a typical ISP provided router, you will probably not be able to configure static routes and have to go down the NAT route.

2
  • Thank you for your help - changing the VM to NAT on Gateway allowed the subnet NIC to reach the internet. Now I'm trying to connect the second node to ping NIC 1 on the Gateway (ex pinging 192.168.120.131 from Node works but pinging 192.168.1.108 does not). Do you think a route needs to be added on the Gateway to handle this? Jul 1, 2016 at 18:21
  • To be clear, when I'm saying you need to enable NAT on the eno16777736 interface, I mean via iptables, not by changing the NIC type on the VM host itself. Jul 1, 2016 at 18:35

You must log in to answer this question.

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