LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 12-01-2011, 04:49 AM   #1
ThomasRonshof
Member
 
Registered: Aug 2006
Posts: 133

Rep: Reputation: 0
Changing the NIC for a guest dynamically on Cent OS 6.0


Hi,

On Cent OS 6.0 I have 2 NIC's, eth0 and eth1. I have defined a bridge br0 for eth0 and br1 for eth1.

When defining new guests, I will be able to use either br0 or br1, regarding loadbalancing and security.

I have tried to simulate that eth0 breaks down. Pulling the cable out. Now the guests on br0 of course can't be accessed. The guests on br1 still works :-)

How do I change a NIC for an existing guest from br0 to br1 ?

I have tried using Virtual Machine Manager to add new NIC card, even using same MAC address af the old NIC or changing ifcfg-eth0 on the guest to new MAC addr, but this doesn't work. There no network working. Something more must be done ?

Regards.
 
Old 12-05-2011, 04:05 AM   #2
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 995

Rep: Reputation: 115Reputation: 115
if both NICs are on the same network, you should bond them together, and use a single bridge. You could use brctl to attach NICs to bridges, but this is not an automated or in any way a correct solution.
 
Old 12-05-2011, 04:13 AM   #3
ThomasRonshof
Member
 
Registered: Aug 2006
Posts: 133

Original Poster
Rep: Reputation: 0
Thanks.

I'm okay with the non-automated solution.

You say I can use brctl instead of the Virtual Machine Manager, that doesn't work ?
 
Old 12-06-2011, 04:34 AM   #4
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 995

Rep: Reputation: 115Reputation: 115
I can't see why you cannot use bonding
 
Old 12-06-2011, 04:42 AM   #5
ThomasRonshof
Member
 
Registered: Aug 2006
Posts: 133

Original Poster
Rep: Reputation: 0
Because I don't know how to set it up.

;-)
 
Old 12-09-2011, 09:13 AM   #6
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 995

Rep: Reputation: 115Reputation: 115
There are tons of guides out there, bonding is just above network basics, no magic involved
 
Old 12-12-2011, 06:52 AM   #7
ThomasRonshof
Member
 
Registered: Aug 2006
Posts: 133

Original Poster
Rep: Reputation: 0
Made it work now ! :-)

Made a ifcfg-bond0. Changed ifcfg-eth0 + 1 to be af slave and master=bond0
Made a br0 for bond0 and all works !

Increased bandwidth and redundancy :-))
 
Old 12-12-2011, 10:13 AM   #8
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 995

Rep: Reputation: 115Reputation: 115
great, and congrats on learning something new!

Which bonding mode are you using, btw?
 
Old 12-13-2011, 01:51 AM   #9
ThomasRonshof
Member
 
Registered: Aug 2006
Posts: 133

Original Poster
Rep: Reputation: 0
At the moment, I haven't used any Bonding-options yet. I know I MUST use either arp_interval and arp_ip_target OR miimon.

Have you any recommendations ?

My 4 files look like this at the moment:

DEVICE=bond0
#IPADDR=192.168.10.40
#NETMASK=255.255.255.0
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
BONDING_OPTS=""
BRIDGE=br0

DEVICE=br0
NM_CONTROLLED="no"
BOOTPROTO=static
IPADDR=192.168.10.45
ONBOOT=yes
TYPE=Bridge
GATEWAY=192.168.10.1
DELAY=0
NETMASK=255.255.255.0

DEVICE=eth0
NM_CONTROLLED="no"
HWADDR=00:1B:21:C3:FD:88
ONBOOT=yes
TYPE=Ethernet
MASTER=bond0
SLAVE=yes

DEVICE=eth1
NM_CONTROLLED="no"
HWADDR=D0:27:88:33E:51
ONBOOT=yes
TYPE=Ethernet
MASTER=bond0
SLAVE=yes


Don't it look correct ? It seems to work, but I need to study the bonding-options.
 
Old 12-13-2011, 07:12 AM   #10
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 995

Rep: Reputation: 115Reputation: 115
cat /proc/net/bonding/bond0
 
Old 12-13-2011, 07:20 AM   #11
ThomasRonshof
Member
 
Registered: Aug 2006
Posts: 133

Original Poster
Rep: Reputation: 0
Gives me this:

Ethernet Channel Bonding Driver: v3.5.0 (November 4, 2008)

Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth0
MII Status: up
Link Failure Count: 0
Permanent HW addr: 5c:f3:fc:5b:02:08

Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 5c:f3:fc:5b:02:0a



dmesg say in the end:

kvm: 16154: cpu7 unhandled wrmsr: 0x198 data 0
kvm: 16154: cpu8 unhandled wrmsr: 0x198 data 0
kvm: 16154: cpu9 unhandled wrmsr: 0x198 data 0
kvm: 16154: cpu0 unimplemented perfctr wrmsr: 0xc1 data 0x0
kvm: 16154: cpu0 unimplemented perfctr wrmsr: 0x186 data 0x130079
kvm: 16154: cpu0 unimplemented perfctr wrmsr: 0xc1 data 0xffe18e99
kvm: 16154: cpu0 unimplemented perfctr wrmsr: 0x186 data 0x530079
kvm: 16154: cpu1 unimplemented perfctr wrmsr: 0xc1 data 0x0
kvm: 16154: cpu1 unimplemented perfctr wrmsr: 0x186 data 0x130079
kvm: 16154: cpu1 unimplemented perfctr wrmsr: 0xc1 data 0xffe18e99
kvm: 16154: cpu1 unimplemented perfctr wrmsr: 0x186 data 0x530079
kvm: 16154: cpu2 unimplemented perfctr wrmsr: 0xc1 data 0x0
kvm: 16154: cpu2 unimplemented perfctr wrmsr: 0x186 data 0x130079
bond0: received packet with own address as source address
bond0: received packet with own address as source address
bond0: received packet with own address as source address
bond0: received packet with own address as source address
bond0: received packet with own address as source address
bond0: received packet with own address as source address
bond0: received packet with own address as source address
bond0: received packet with own address as source address
bond0: received packet with own address as source address

Is it "normal" with theese messages ? Also from kvm ?
 
Old 12-13-2011, 10:48 AM   #12
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 995

Rep: Reputation: 115Reputation: 115
Quote:
Bonding Mode: load balancing (round-robin)
this is the problem - this mode is not compatible with a linux bridge. Another mode that has the same problem is balance-alb or mode - 6.

The best option for you is mode-4 or 802.3ad, but to use this mode, you need to make sure your switch supports it, and configure the switch for LACP
 
Old 12-14-2011, 01:55 AM   #13
ThomasRonshof
Member
 
Registered: Aug 2006
Posts: 133

Original Poster
Rep: Reputation: 0
Ok..... well, the customers switch'es are not new and the one I just delivered with the server, just for the new rack isn't 802.3ad compliant.

So I must remove the bonding and go back to my first solution, with 2 bridges ? Without the increased bandwidth and redundancy :-(
 
Old 12-14-2011, 02:12 AM   #14
ThomasRonshof
Member
 
Registered: Aug 2006
Posts: 133

Original Poster
Rep: Reputation: 0
I have google't a little, and found that some recommend using mode 5 when using bonding + bridging in a virt environment....
 
Old 12-14-2011, 02:32 AM   #15
ThomasRonshof
Member
 
Registered: Aug 2006
Posts: 133

Original Poster
Rep: Reputation: 0
or mode 1 ....
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ubuntu server guest on Cent OS 6.0 host. ThomasRonshof Linux - Virtualization and Cloud 5 10-26-2011 07:13 AM
dynamically changing delay pool acl squid.conf lasantha Linux - Server 1 05-05-2009 04:39 AM
Cannot access Internet from Vmware guest : Cent O/S when adsl router is bridge mode kumvinod Linux - Networking 0 03-02-2009 11:42 AM
Changing time on clock on cent os 5 ? centosfan Linux - Distributions 1 11-02-2008 04:27 PM
changing samba configuration dynamically ramu_ak Linux - Networking 1 12-28-2003 02:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

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