View previous topic :: View next topic |
Author |
Message |
syl22_00 n00b
Joined: 31 Aug 2011 Posts: 14
|
Posted: Thu Feb 21, 2013 10:14 am Post subject: Keep network access on device after it is attached to bridge |
|
|
Hi,
I am creating a bridge to be used as device for a XEN guest. My physical device is eth0 and the bridge is xenbr0. After I start xenbr0 I lose connectivity on eth0. Meanwhile, the guest can access the network.
Here is /etc/conf.d/net:
Code: |
config_eth0="192.168.1.61 netmask 255.255.255.0 brd 192.168.1.255"
routes_eth0="default via 192.168.1.1"
dns_servers_eth0="192.168.1.14"
bridge_xenbr0="eth0"
config_xenbr0="dhcp"
routes_xenbr0="default via 192.168.1.1"
brctl_xenbr0="setfd 0
sethello 10
stp off"
rc_net_xenbr0_need="net.eth0"
|
I am quite confused whether I should turn on or off ip forwarding, in /proc/sys/net/ipv4/ip_forward or in /etc/sysctl.conf, and whether I should add entries to iptables. Any help would be very appreciated. |
|
Back to top |
|
|
AngelKnight Tux's lil' helper
Joined: 14 Jan 2003 Posts: 127
|
Posted: Sun Feb 24, 2013 11:07 am Post subject: |
|
|
Hi,
This config exhibits conceptual errors with regard to what ethernet bridges in Linux are and how they work. Try this:
Code: | config_eth0="null"
bridge_xenbr0="eth0"
config_xenbr0="dhcp
192.168.1.61/24"
routes_xenbr0="default via 192.168.1.1"
brctl_xenbr0="setfd 0
sethello 10
stp off"
dns_servers_xenbr0="192.168.1.14" # This might bomb out if you require the DNS server provided by DHCP
rc_net_xenbr0_need="net.eth0" |
The conceptual error is in thinking that an IP address belongs to a specific adapter. It doesn't; it belongs to the host. An IP was traditionally "bound" to a specific adapter in order to let the kernel know where the L3 network to which that address belongs belongs. (The previous sentence really does make sense; read it again.) |
|
Back to top |
|
|
|