public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Hugo R Hernández-Mora" <hdezmora@gmail.com>
To: kvm@vger.kernel.org
Subject: KVM VM's facing public network
Date: Tue, 29 Jan 2013 12:53:21 -0500	[thread overview]
Message-ID: <51080C91.8090204@gmail.com> (raw)

Hello there,
we are experiencing a problem by configuring a KVM bridged networking to 
share a public network interface between the KVM host and the VMs. 
Currently, our KVM server has set three network interfaces as follows:

* eth0: 192.168.10.101/23 (main interface for public network - no bridge)
* eth1 <--> br1: 192.168.10.201/23 (KVM VMs connected to public network)
* eth3 <--> br3: 10.7.10.201/23 (KVM VMs connected to LAN)

We have followed instructions as from Red Hat as well as from diferrent 
web sites and we are not able to get the VMs to get access into/from the 
public network. Here is a more detailed configuration for the KVM host:

ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
HWADDR=AC:80:B2:14:C5:EE
BOOTPROTO=none
IPADDR=192.168.10.101
NETMASK=255.255.254.0

ifcfg-eth1
DEVICE=eth1
ONBOOT=yes
HWADDR=AC:80:B2:4E:D3:28
BRIDGE=br1

ifcfg-br1
DEVICE=br1
ONBOOT=yes
TYPE=Bridge
BOOTPROTO=none
IPADDR=192.168.10.201
NETMASK=255.255.254.0
STP=off
DELAY=0

ifcfg-eth3
DEVICE=eth3
ONBOOT=yes
HWADDR=AC:80:B2:4E:D3:2A
BRIDGE=br3

ifcfg-br3
DEVICE=br3
ONBOOT=yes
TYPE=Bridge
BOOTPROTO=static
IPADDR=10.7.10.201
NETMASK=255.255.254.0
STP=off
DELAY=0

network
NETWORKING=yes
HOSTNAME=kvm1.public-lan.net
GATEWAY=192.168.10.1

For iptables/routing, we have followed instructions as explained on 
http://www.linux-kvm.org/page/Networking#public_bridge
*nat
:POSTROUTING ACCEPT [0:0]
-A POSTROUTING --out-interface br1 -j MASQUERADE
COMMIT
:FORWARD ACCEPT [0:0]
-A FORWARD --in-interface br1 -j ACCEPT

Hostside:
Allow IPv4 forwarding and add route to client (could be put in a script 
- route has to be added after the client has started):
sysctl -w net.ipv4.ip_forward=1 # allow forwarding of IPv4
route add -host <ip-of-client> dev <tap-device> # add route to the client

Clientside:
Default GW of the client is of course then the host (<ip-of-host> has to 
be in same subnet as <ip-of-client> ...):
route add default gw <ip-of-host>

But it doesn't seem to work. My assumption the problem is related with a 
wrong setting of the firewall on the iptables. Could you please advice? 
Your help will be greatly appreciated!

We are running Scientific Linux 6.2 on the KVM server as well as on the 
VMs. There is no network issue by accessing the LAN between VMs but only 
to face the public network.

Thanks in advance,
-Hugo

             reply	other threads:[~2013-01-29 17:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-29 17:53 Hugo R Hernández-Mora [this message]
2013-01-29 21:37 ` KVM VM's facing public network Brian Jackson
2013-01-29 22:15   ` Hugo R. Hernandez-Mora
2013-01-29 23:23     ` Brian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51080C91.8090204@gmail.com \
    --to=hdezmora@gmail.com \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox