LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-07-2011, 02:18 PM   #1
rysic
LQ Newbie
 
Registered: Aug 2011
Posts: 21

Rep: Reputation: Disabled
Question bonding + bridge + lxc = virtual host routing problem


Hello everybody! This is my first post

I have created one virtual machine using lxc in Debian. In main host there are two network interfaces - eth5, eth5 and this interfaces are connected via bounding (bond0) and then, there is a bridge from bond0 to br0 becouse lxc requires that bridge.
It looks like that:

Main host configuration:


Code:
root@PLHQSRDMZ01:~# cat /etc/network/interfaces 
auto lo
iface lo inet loopback

auto bond0
iface bond0 inet manual
slaves eth5 eth6
bond-mode active-backup
bond-miimon 100
bond-downdelay 0
bond-updelay 0

auto br0
iface br0 inet static
address 10.50.12.100
netmask 255.255.255.0
gateway 10.50.12.1
network 10.50.10.0
bridge_ports bond0
bridge_fd 0
bridge_maxwait 0
bridge_stp off
Code:
root@PLHQSRDMZ01:~# ifconfig 
bond0 Link encap:Ethernet HWaddr 08:00:27:95:e4:45 
inet6 addr: fe80::a00:27ff:fe95:e445/64 Scope:Link
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:515 errors:0 dropped:0 overruns:0 frame:0
TX packets:132 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0 
RX bytes:37405 (36.5 KiB) TX bytes:13712 (13.3 KiB)

br0 Link encap:Ethernet HWaddr 08:00:27:95:e4:45 
inet addr:10.50.12.100 Bcast:10.50.12.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe95:e445/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:514 errors:0 dropped:0 overruns:0 frame:0
TX packets:126 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0 
RX bytes:27959 (27.3 KiB) TX bytes:13244 (12.9 KiB)

eth5 Link encap:Ethernet HWaddr 08:00:27:95:e4:45 
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:514 errors:0 dropped:0 overruns:0 frame:0
TX packets:132 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000 
RX bytes:37345 (36.4 KiB) TX bytes:13712 (13.3 KiB)

eth6 Link encap:Ethernet HWaddr 08:00:27:95:e4:45 
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:1 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000 
RX bytes:60 (60.0 B) TX bytes:0 (0.0 B)

lo Link encap:Local Loopback 
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0 
RX bytes:560 (560.0 B) TX bytes:560 (560.0 B)
Code:
root@PLHQSRDMZ01:~# cat /proc/net/bonding/bond0 
Ethernet Channel Bonding Driver: v3.5.0 (November 4, 2008)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth5
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth5
MII Status: up
Link Failure Count: 0
Permanent HW addr: 08:00:27:95:e4:45

Slave Interface: eth6
MII Status: up
Link Failure Count: 0
Permanent HW addr: 08:00:27:48:60:b1
Code:
root@PLHQSRDMZ01:~# cat /var/lib/lxc/plhqsrwww01/config 
lxc.tty = 4
lxc.pts = 1024
lxc.rootfs = /var/lib/lxc/plhqsrwww01/rootfs
lxc.cgroup.devices.deny = a
# /dev/null and zero
lxc.cgroup.devices.allow = c 1:3 rwm
lxc.cgroup.devices.allow = c 1:5 rwm
# consoles
lxc.cgroup.devices.allow = c 5:1 rwm
lxc.cgroup.devices.allow = c 5:0 rwm
lxc.cgroup.devices.allow = c 4:0 rwm
lxc.cgroup.devices.allow = c 4:1 rwm
# /dev/{,u}random
lxc.cgroup.devices.allow = c 1:9 rwm
lxc.cgroup.devices.allow = c 1:8 rwm
lxc.cgroup.devices.allow = c 136:* rwm
lxc.cgroup.devices.allow = c 5:2 rwm
# rtc
lxc.cgroup.devices.allow = c 254:0 rwm

lxc.utsname = plhqsrwww01
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br0
#lxc.network.hwaddr = 00:FF:12:34:56:00
lxc.network.ipv4 = 10.50.12.101/25

# mounts point
lxc.mount.entry=proc /var/lib/lxc/plhqsrwww01/rootfs/proc proc nodev,noexec,nosuid 0 0
lxc.mount.entry=devpts /var/lib/lxc/plhqsrwww01/rootfs/dev/pts devpts defaults 0 0
lxc.mount.entry=sysfs /var/lib/lxc/plhqsrwww01/rootfs/sys sysfs defaults 0 0
Code:
root@PLHQSRDMZ01:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.50.12.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
0.0.0.0 10.50.12.1 0.0.0.0 UG 0 0 0 br0
Virtual host configuration:
Code:
plhqsrwww01:~# ifconfig 
eth0 Link encap:Ethernet HWaddr e6:7b:db:5a:dc:95 
inet addr:10.50.12.101 Bcast:10.50.12.0 Mask:255.255.255.0
inet6 addr: fe80::e47b:dbff:fe5a:dc95/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:19 errors:0 dropped:0 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000 
RX bytes:904 (904.0 B) TX bytes:384 (384.0 B)

lo Link encap:Local Loopback 
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0 
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Code:
plhqsrwww01:~# cat /etc/network/interfaces 
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 10.50.12.101
netmask 255.255.255.0
gateway 10.50.12.1
Code:
plhqsrwww01:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.50.12.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 10.50.12.1 0.0.0.0 UG 0 0 0 eth0
And using that cfg, I can ping from main host router (10.50.12.100-->10.50.12.1) from main host, virtual host (10.50.12.100-->10.50.12.101) and vurtual host can ping main host (10.50.12.101-->10.50.12.100) but virtual host can't ping router (10.50.12.101 ---xxx--- 10.50.12.1). What can be problem here?
 
  


Reply



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
Problem routing to a virtual IP? DJCharlie Linux - Server 5 01-11-2011 10:23 PM
VMware: XP Host; Ubuntu Guest; Bridge Networking. VMnet0 problem masque7 Linux - Networking 1 10-14-2010 10:44 AM
Problem routing email from LAN host using Exim 4.43-1 neiljt Linux - Server 0 03-11-2007 09:42 AM
Multihomed host routing problem.. srns Linux - Networking 3 10-15-2004 03:26 PM
newbie problem with routing to host?? lucastic Linux - Networking 5 08-03-2003 09:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:40 AM.

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