LinuxQuestions.org
Help answer threads with 0 replies.
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 07-13-2014, 08:32 AM   #1
tklima
LQ Newbie
 
Registered: Jan 2005
Posts: 16

Rep: Reputation: 0
KVM guest with 2 network interfaces in diferrent VLANs


Hi all,

I would like to configure a guest VM which will have two network interfaces in different VLANs (106,711).

the host configuration looks as follows:
/etc/sysconfig/network-scripts/ifcfg-eth0 (connected to a trunk port)
Code:
DEVICE=eth0
BOOTPROTO=none
HWADDR=00:22:19:D4:25:A8
IPV6INIT=no
IPV6_AUTOCONF=no
ONBOOT=yes
TYPE=Ethernet
/etc/sysconfig/network-scripts/ifcfg-eth0.106
Code:
DEVICE=eth0.106
BOOTPROTO=none
HWADDR=00:22:19:D4:25:A8
ONBOOT=yes
TYPE=Ethernet
VLAN=yes

/etc/sysconfig/network-scripts/ifcfg-eth0.711
Code:
DEVICE=eth0.711
BOOTPROTO=none
HWADDR=00:22:19:D4:25:A8
ONBOOT=yes
TYPE=Ethernet
VLAN=yes
Then I added two bridges for both VLANs
Code:
brctl addbr br0
brctl addif br0 eth0.711
ifconfig br0 10.56.2.2 netmask 255.255.255.240 up
brctl addbr br1
brctl addif br1 eth0.106
ifconfig br1 10.238.22.8 netmask 255.255.255.0
and created two tap interfaces and added them to the corresponding bridges.
Code:
tunctl -b -u root
ifconfig tap0 up
brctl addif br0 tap0
tunctl -b -u root
ifconfig tap1 up
brctl addif br1 tap1
The brctl show command output looks fine:
Code:
brctl show
bridge name	bridge id		STP enabled	interfaces
br0		8000.002219d425a8	no		tap0
							eth0.711
br1		8000.002219d425a8	no		tap1
							eth0.106
The virtual machine is started
Code:
/usr/libexec/qemu-kvm -hda /data/disk.raw  -smp 2 -m 2G -net nic,macaddr=52:54:00:12:34:55 -net tap,ifname=tap0,script=no  -net nic,macaddr=52:54:00:12:34:75 -net tap,ifname=tap1,script=no
The guest has 2 interfaces (eth0=tap0,eth1=tap1)
The problem I have is that even though the tap1 interface is bridged to the VLAN 106 the eth1 interface in the guest still gets an IP address from the VLAN 711. Is my setup correct or am I missing anything?


I use CentOS 5.6 as the host system.

Thanks for your help

Tomas
 
Old 07-20-2014, 02:26 PM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
As you said that you are using CentOS as host I am assuming you are using libvirtd. Check network card settings in virt-manager for this guest for both the NIC, as you said that they should be pointing to different VLAN it should be configured at guest level accordingly in virt-manager.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Not able to establish network between host and guest in KVM Jerico91 Linux - Newbie 2 10-18-2013 04:06 PM
Can't configure network for KVM guest. bluefish1 Linux - Server 9 05-09-2013 01:25 PM
RHEL6 KVM Host / guest network doesn't chrism01 Linux - Virtualization and Cloud 2 08-19-2012 09:33 PM
[KVM] adding guest computer to the network djgerbavore Linux - Networking 5 06-10-2009 02:01 PM
the network scripts to create network interfaces for 802.1q VLANs 10 and 11, Lahore Linux - Networking 0 03-18-2009 05:45 AM

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

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