I
I
iandriyanov2012-04-09 13:21:08
linux
iandriyanov, 2012-04-09 13:21:08

Xen-bridging ifaces

Who faced the problem of bridging, viz. The bridge is transparent, it has DHCP on its tail, however, on a raised virtual machine, nothing comes to the interface via DHCP.

#:uname -a
Linux ulskpal 3.0.0-17-server #30-Ubuntu SMP Thu Mar 8 22:15:30 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

#:lsb_release
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 11.10
Release: 11.10
Codename: oneiric

#############
SOLUTION
#############

However, a solution has been found. And God will judge them in this Canon!

It is necessary to add everything else for the bridge to /etc/xen/xend-config.sxp: (the exact indication of the name of the bridge is bridge=xenbr1 )

brctl show - узнать имя бриджа для интерфейса.


(network-script 'network-bridge netdev=eth1 bridge=xenbr1')


And the guest CLEARLY indicate his ip, despite the fact that even he will receive it via dhcp (I have dhcp configured so that it binds to the poppy and I'm sure that the ip-shka will not change without my knowledge from here): Interestingly, SUCH happens only in ubuntu server. This is not necessary on Debian, I would even say that such a configuration breaks the network. It's even easier on Gentoo.

vif = ['type=ioemu, mac=00:2c:02:f2:72:5b, ip=192.168.144.61, bridge=xenbr1' ]


Answer the question

In order to leave comments, you need to log in

6 answer(s)
I
iandriyanov, 2012-04-10
@iandriyanov

However, a solution has been found. And God will judge them in this Canon!
It is necessary to add everything else for the bridge to /etc/xen/xend-config.sxp: (exact indication of the name of the bridge bridge=xenbr1 ) configured so that it binds to a poppy and I'm sure that the ip-shka will not change without my knowledge from here): Interestingly, SUCH happens only in Ubuntu Server. This is not necessary on Debian, I would even say that such a configuration breaks the network. It's even easier on Gentoo.
brctl show - узнать имя бриджа для интерфейса.

(network-script 'network-bridge netdev=eth1 bridge=xenbr1')

vif = ['type=ioemu, mac=00:2c:02:f2:72:5b, ip=192.168.144.61, bridge=xenbr1' ]

M
Maxim, 2012-04-09
@Maxim_ka

I think the best advice is a working example, below are the files that are on my production server:

[[email protected] ~]# cat /etc/xen/xend-config.sxp | grep vif-script
(vif-script vif-bridge)
#(vif script vif route)
#(vif-script vif-nat)
[[email protected] ~]# cat /etc/xen/xend-config.sxp | grep network-script
# (network-script network-bridge)
#(network-script network-xen-multi-bridge)
(network-script 'network-bridge netdev=eth2')
# (network-script 'network-bridge bridge=<name>')
#(network-script network-bridge)
# (network-script 'network-bridge bridge=<name>') then you may wish to do the
#(network-script network-route)
#(network-script network-nat)

This is the config of the guest system, it is running Ubuntu server 10.04. Two network interfaces, one physical, the one you need, it looks into the local network, receives DHCP, etc. (Now it is set to static).
The second shares the network interface with the host system, and receives the Internet from it, behind NAT So to speak.
[[email protected] ~]# cat /etc/xen/Ubuntu_squid_sams
name="ubuntu_squid_sams"
uuid="7cc14ee2-5be9-b5ad-ce3f-f3d01f821a09"
maxmem = 256
memory = 256
vcpus=1
builder="hvm"
kernel="/usr/lib/xen/boot/hvmloader"
boot="c"
pae = 1
acpi=1
apic = 1
localtime=0
on_poweroff = "destroy"
on_reboot = "restart"
on_crash = "restart"
device_model = "/usr/lib64/xen/bin/qemu-dm"
sdl = 0
vnc=1
vncunused=1
keymap="en"
disk = [ "phy:/dev/sda9,hda,w", ",hdc:cdrom,r" ]
vif = [ "mac=00:16:36:2f:26:7a,bridge=virbr0,script=vif-bridge", "mac=00:16:36:3b:21:97,bridge=xenbr0,script= vif-bridge" ]
parallel="none"
serial = "pty"
extra="xencons=pty"

Try to see if it does not work, we will understand in detail.

M
Maxim, 2012-04-09
@Maxim_ka

My working day is coming to an end, I won’t be able to go into no soon, I can leave my own question for help, about the network in XEN:
habrahabr.ru/qa/10302/
And yet, all manuals say to do exactly like this, with regard to xend -config.sxp
Configure the bridge. To do this, add to the file /etc/network/interfaces in the settings of your network card:
up /etc/xen/scripts/network-bridge start
Configure XEN. Add/uncomment lines in /etc/xen/xend-config.sxp:
(network-script 'network-bridge bridge=eth0 antispoof=yes')
(vif-script vif-bridge)
Should work.

I
iandriyanov, 2012-04-09
@iandriyanov

1 - etc/xen/xend-config.sxp:
(network-script 'network-bridge bridge=xenbr1 netdev=eth1 antispoof=yes')
(vif-script vif-bridge)
2 - Guest conf (/home/xen/config /gen32_test)
kernel = '/usr/lib/xen-4.1/boot/hvmloader'
builder = 'hvm'
memory = '800'
device_model='/usr/lib/xen-4.1/bin/qemu-dm'
### ################################################### ##############################
# Disks
disk = [ 'file:/home/xen/image/gen32_test.raw,ioemu :hda,w',
'file:/home/xen/install-x86-minimal-20120306.iso,ioemu:hdc:cdrom,r' ]
# Hostname
name = 'gen32_test'
# Networking
#vif = ['type=ioemu , model=e1000, mac=00:0c:29:02:76:47']
vif = ['type=ioemu, mac=00:2c:02:f2:72:5b, bridge=xenbr1']
vcpus = 1
apic = 0
acpi = 1
pae = 1
# boot floppy (a), hard disk © CD -ROM(d).
boot='d'
localtime=1
vnc=1
vnclisten = '0.0.0.0'
#vncconsole=0
#vncviewer=1
stdvga=0
#vncunused = 1
sdl=0
serial=''
on_reboot = 'restart'
on_crash = 'destroy'
on_poweroff = 'destroy'

I
iandriyanov, 2012-04-09
@iandriyanov

On the host, it was DHCP that assigned the address 144.5. Hands on the guest, I took the neighboring ip-shku.

G
Gregory, 2012-04-10
@gvas_ru

Describe the bridge in advance in conf.d/net (hence habrahabr.ru/post/131196/ )
bridge_br0="eth0"
rc_need_br0="net.eth0"
config_eth0=("null")
config_br0=(
"x.x.x.x/27"
"192.168.194.1/24" для общения с виртуалками
)
routes_br0=("default gw y.y.y.y")

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question