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 02-09-2010, 09:30 AM   #1
redrum123
LQ Newbie
 
Registered: Feb 2010
Posts: 4

Rep: Reputation: 0
Routing for 2 IP bonds with xen virtualisation.......and different network ranges


I'm trying to setup the following on a red hat 5 HP DL380 server:
(2 bonds mapped to 2 xen bridges on 2 different networks)

interfaces bond xen bridge network
eth0&eth1 -> bond0 -> xenbr0 -> 172.16.6.0/24
eth2&eth3 -> bond1 -> xenbr1 -> 172.16.5.0/24

For IP bonding I want the OS be responsible for configuring the Network Bridges(not xend).
So I've commented out any line starting with '(network-script' in the /etc/xen/xend-config.sxp file.

My configuration is as follows:
1) For Bond0:

[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none

[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none

[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
BOOTPROTO=none
ONBOOT=yes
#BONDING_OPTS="mode=1 miimon=100"
BRIDGE=xenbr0

[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-xenbr0
DEVICE=xenbr0
IPADDR=172.16.5.172
NETMASK=255.255.255.0
NETWORK=172.16.5.0
#GATEWAY=172.16.5.1
BROADCAST=172.16.5.255
ONBOOT=yes
TYPE=bridge
USERCTL=no
BOOTPROTO=none




2) For Bond1
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth2
DEVICE=eth2
USERCTL=no
ONBOOT=yes
MASTER=bond1
SLAVE=yes
BOOTPROTO=none

[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth3
DEVICE=eth3
USERCTL=no
ONBOOT=yes
MASTER=bond1
SLAVE=yes
BOOTPROTO=none

[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-bond1
DEVICE=bond1
BOOTPROTO=none
ONBOOT=yes
#BONDING_OPTS="mode=1 miimon=100"
BRIDGE=xenbr1

[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-xenbr1
DEVICE=xenbr1
IPADDR=172.16.6.172
NETMASK=255.255.255.0
NETWORK=172.16.6.0
#GATEWAY=172.16.6.1
BROADCAST=172.16.6.255
ONBOOT=yes
TYPE=bridge
USERCTL=no
BOOTPROTO=none



The modprobe.conf is setup as follows:
[root@localhost ~]# cat /etc/modprobe.conf
alias eth0 bnx2
alias eth1 bnx2
alias eth2 e1000e
alias eth3 e1000e
alias scsi_hostadapter cciss
alias scsi_hostadapter1 ata_piix
alias bond0 bonding
alias bond1 bonding
options bond0 mode=1 miimon=100
options bond1 mode=1 miimon=100



I have defined two static routes for each bond, to communicate via 2 different gateways:
[root@localhost ~]# cat /etc/sysconfig/network-scripts/route-xenbr0
172.16.5.0/24 via 172.16.5.1

[root@localhost ~]# cat /etc/sysconfig/network-scripts/route-xenbr1
172.16.6.0/24 via 172.16.6.1


The network file is as follows:
[root@localhost ~]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=localhost.localdomain
GATEWAY=172.16.5.1




The problem is that in the routing table, it seems that both networks are routed via the default gateway:
[root@localhost ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.16.6.0 * 255.255.255.0 U 0 0 0 xenbr1
172.16.5.0 * 255.255.255.0 U 0 0 0 xenbr0
192.168.122.0 * 255.255.255.0 U 0 0 0 virbr0
169.254.0.0 * 255.255.0.0 U 0 0 0 xenbr1
default 172.16.5.1 0.0.0.0 UG 0 0 0 xenbr0


The routes I wish to see are:
Destination Gateway Genmask Flags Metric Ref Use Iface
172.16.6.0 172.16.6.1 255.255.255.0 U 0 0 0 xenbr1
172.16.5.0 * 255.255.255.0 U 0 0 0 xenbr0


So the static routes that are configured, do not seem to taking effect.

Has anybody encountered an issue like this before, or knows where to point me in the right direction?
 
Old 02-10-2010, 07:23 AM   #2
backtolinux
LQ Newbie
 
Registered: Nov 2009
Posts: 20
Blog Entries: 1

Rep: Reputation: 2
create xenbr2 as a new bridge, where xenbr0 and xenbr1 connect against it
and xenbr2 will be the default interface for your network.
or use the metric to distinguish the both
 
Old 02-12-2010, 08:49 AM   #3
redrum123
LQ Newbie
 
Registered: Feb 2010
Posts: 4

Original Poster
Rep: Reputation: 0
issue resolved:

defioned static routes in file in /etc/sysconfig/, rather than in the /etc/sysconfig/network-scripts/route-<device> file.

[root@localhost html]# cat /etc/sysconfig/static-routes
#Route to network 1
any net 172.16.5.0 netmask 255.255.255.0 gw 172.16.5.1 xenbr0

#Route to network2
any net 172.16.6.0 netmask 255.255.255.0 gw 172.16.6.1 xenbr1



[root@localhost html]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.16.6.0 172.16.6.1 255.255.255.0 UG 0 0 0 xenbr1
172.16.6.0 * 255.255.255.0 U 0 0 0 xenbr1
172.16.5.0 172.16.5.1 255.255.255.0 UG 0 0 0 xenbr0
172.16.5.0 * 255.255.255.0 U 0 0 0 xenbr0
192.168.122.0 * 255.255.255.0 U 0 0 0 virbr0
169.254.0.0 * 255.255.0.0 U 0 0 0 xenbr1
default 172.16.5.1 0.0.0.0 UG 0 0 0 xenbr0







[root@localhost html]# ip route get 172.16.6.189
172.16.6.189 via 172.16.6.1 dev xenbr1 src 172.16.6.172
cache mtu 1500 advmss 1460 hoplimit 64


[root@localhost html]# ip route get 172.16.5.189
172.16.5.189 via 172.16.5.1 dev xenbr0 src 172.16.5.172
cache mtu 1500 advmss 1460 hoplimit 64
 
  


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
Routing on 2 bonds/xen bridges over two different networks redrum123 Linux - Software 1 02-09-2010 06:57 AM
LXer: Managing Xen With Xen-Tools, Xen-Shell, And Argo LXer Syndicated Linux News 0 10-21-2006 11:33 PM
LXer: Xen - A GPLed Virtualisation Technology for Linux LXer Syndicated Linux News 0 10-20-2006 01:03 PM
Network on 2 Ranges threegig Linux - Networking 5 07-01-2006 03:51 AM
network address ranges WeNdeL Linux - Networking 4 03-12-2003 10:56 AM

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

All times are GMT -5. The time now is 05:26 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