public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* KVM VM's facing public network
@ 2013-01-29 17:53 Hugo R Hernández-Mora
  2013-01-29 21:37 ` Brian Jackson
  0 siblings, 1 reply; 4+ messages in thread
From: Hugo R Hernández-Mora @ 2013-01-29 17:53 UTC (permalink / raw)
  To: kvm

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-01-29 23:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-29 17:53 KVM VM's facing public network Hugo R Hernández-Mora
2013-01-29 21:37 ` Brian Jackson
2013-01-29 22:15   ` Hugo R. Hernandez-Mora
2013-01-29 23:23     ` Brian Jackson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox