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

I created a virtual NAT network ( network) in my libvirt and new guest with two interfaces - one in this network, one as bridged ( network) to the local LAN. The reason for that is I need to have my own virtual network for my DHCP/TFTP/DNS testing and still want to access my guest externally from my LAN. On both networks I have working DHCP, both giving them IP addresses.

When I setup NAT port forwarding (e.g. for ssh), I can connect to the eth0 (virtual network), everything is fine.

But when I try to access the eth1 via bridged interface, I have no response. I guess I have problem with my routing table - outgoing packets are routed to the virtual NAT network (which has access to the machine I am connecting from - I can ping it). But I am not sure if this setup is correct. I think I need to add something to my routing table.

# ifconfig 
eth0      Link encap:Ethernet  HWaddr 52:54:00:B4:A7:5F  
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::5054:ff:feb4:a75f/64 Scope:Link
          RX packets:16468 errors:0 dropped:27 overruns:0 frame:0
          TX packets:6081 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:22066140 (21.0 MiB)  TX bytes:483249 (471.9 KiB)
          Interrupt:11 Base address:0x2000 

eth1      Link encap:Ethernet  HWaddr 52:54:00:DE:16:21  
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::5054:ff:fede:1621/64 Scope:Link
          RX packets:34 errors:0 dropped:0 overruns:0 frame:0
          TX packets:189 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:4911 (4.7 KiB)  TX bytes:9

# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface   U     0      0        0 eth0   U     0      0        0 eth1     U     1002   0        0 eth0     U     1003   0        0 eth1         UG    0      0        0 eth0

Network I am trying to connect from is different than network the hypervisor is connected to: But it is accessible from that network. So I tried to add new route rule:

route add -net netmask dev eth1

And it is not working. I thought setting correct interface would be sufficient. What is needed to get my packets coming through?

share|improve this question
That route command make no sense. It is most likely not a routing issue. I'm guessing your bridging on the host is misconfigured. To simplify troubleshooting I'd exclude the NAT and try to get the bridging to work. – Mark Wagner Apr 6 '12 at 17:49
My libvirt interface works fine. The issue is maybe with my system, I am adding the interface after the system is installed. Will try to install with it. Thanks. – lzap Apr 7 '12 at 12:37
up vote 0 down vote accepted

So the issue was really in the NAT. I changed my default route to be on the second (bridged) interface and it worked. Btw if you really need two default routes, this is possible:

share|improve this answer

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.