Configuration Details

I have a CentOS VM sitting on HyperV host with two interfaces, One interface connected to the domain Network via a switch ( /24) GW Another interface is connected directly to the firewall (fortigate) ( GW above interfaces are also setup as Hyper-V Virtual switches on the Host.

The Gateways are interfaces setup on the FW setup to segregate traffic.

172.20.0.x /29 is public address segment assigned by the ISP.

The guest VM has two interfaces eth0 ( connected via (Virtual Switch) on host. And eth1( connected via (Virtual Switch) on host.

Problem is I can ping both interfaces on the VM from the Host and from the Firewall. But I can not ping eth1( from the internet, but able to reach host interface from the internet.

Please note that CentOS Guest VM can ping Local Area Networks resources and reach internet with source ping from both interfaces.

When I trace route to both addresses and from an external source IP on AWS. I can reach (Host Interface). Route to (VM Interface) terminates just before the firewall from outside.

My train of thought is now leading me to think that there is additional configuration that needs to be done on the FW, maybe add a static route on the FW relaying traffic directly to the VM? Any thoughts? I just want to be sure before I commence with this exercise.


This is a highly unusual configuration, and you have some errors and/or typos.

The normal way to do this would be to setup the Hyper-V switches as an external switches. Doing so allows the VM virtual NICs to talk directly to the other network hardware. E.g. would talk to There is no need for the host to have a network adapter or IP address at all with Similar for the subnet. I'm suspicious that you may have an internal virtual switch setup as a NAT with bad subnetting.

You mention which I assume is a typo of However only covers addresses while you specify the gateway as Since the gateway is not in the subnet this interface cannot route to it. This makes me think that the that you are reaching is not your host, but is in fact a different interface on the firewall or router.

You mention is assigned by the ISP, but you've labeled a router out front, and a firewall behind it, and the VM with the same subnet. The router and firewall should each normally have a different subnet on the inside than outside. It appears you are trying to use the same subnet between the hosts and the firewall that is also used between the firewall and router. While there are such firewalls that act as transparent bridges, it is far more common to have routed segments.

Overall I wonder what you are trying to do. Multi-homing with multiple adapters on different subnets is a relatively rare occurrence, and putting a machine on both the external Internet behind a firewall (let's call it a DMZ) and the internal LAN is a very poor security practice. It's much simpler to do this with one adapter and a DMZ, or one adapter and a NAT, then let the firewall or router route between the DMZ and LAN subnets.


You can't have two default gateways on a single machine, the other one becomes redundant. you can segregate the traffic and route directly from host interface to internet.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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