Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 11-10-2016, 07:41 PM   #1
LQ Newbie
Registered: Nov 2016
Posts: 4

Rep: Reputation: Disabled
KVM routing issue

I have two networks, an internal network and a VM network I have a single VM host in the VMnetwork, the network card is setup for nat and it can ping all the ip addresses in the internal network. The VM is located on a physical server (RHEL7.2 ; and I can ping the vm from that host. However every other host in the network cannot ping the VM (

I assume it has to do with routing. I am guessing I'll have to add something to the routing tables so that instead of going to the internal default gateway ( but to so that it can get to the VM. Am I correct? What do I need to change/add.

Thanks in advance.
Old 11-16-2016, 08:12 PM   #2
Ser Olmy
Senior Member
Registered: Jan 2012
Distribution: Slackware
Posts: 3,347

Rep: Reputation: Disabled
Since the VM uses a NAT setup, all outbound traffic is NATed behind the IP address of the KVM hypervisor. That's why you can reach other hosts on the network; to the other hosts, the traffic appears to originate from 10.1.1.n (where n is the address of the hypervisor), which is a local address.

If you try to ping from a host in the network, the host will determine to be a non-local address and forward the request to its default gateway. Unless the gateway happens to be the KVM hypervisor, this will not work unless you alter the routing setup.

Possible solutions:
  1. Add a route to (or the entire network) on every host in the network, pointing to the KVM hypervisor as the next-hop router (a lot of work and not recommended)
  2. Add a route to on the current default gateway, pointing to the KVM hypervisor a the next-hop gateway (the "correct" solution)
  3. Use the KVM hypervisor as the default gateway for the network (not very elegant and introduces the hypervisor as a single-point-of-failure)
  4. Switch to a bridged setup for your VMs, which will place both VMs and physical hosts in the network (might have security implications)
With solutions 1-3 you can deactivate NATing of traffic from the VMs altogether.


kvm, networking, routing

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] KVM virtual networks not routing properly theillien Linux - Networking 5 10-21-2017 07:37 PM
Routing Issue on KVM Server Bashed Linux - Networking 1 09-29-2015 12:58 PM
Centos 6.3 KVM networking issue Spetsnaz Linux - Virtualization and Cloud 2 06-11-2013 03:04 PM
[SOLVED] Centos 6.3 KVM networking issue easycoder Linux - Virtualization and Cloud 7 12-30-2012 03:00 PM
Kvm guest dns issue Wojk Linux - Virtualization and Cloud 0 11-05-2012 09:03 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:20 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration