Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Starting bridge interface makes eth0 stop respondig
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
BakaO
n00b
n00b


Joined: 27 Sep 2003
Posts: 69

PostPosted: Mon Aug 05, 2013 7:54 pm    Post subject: [SOLVED] Starting bridge interface makes eth0 stop respondig Reply with quote

Hello,
i am new to bridge utilization / configuration, and as such i think i don't understand something important.


i have a working little server that have 1 physical network interface and an openvpn that works too (for my problem maybe openvpn is a hit to find the solution).

because i am trying libvirt with qemu-kvm, i would like to setup a bridge on eth0.

as soon as i try to start the br0 init script, i am unable to use eth0 (and beacause i am using ssh to this headless server, i can't do anything after loosing the connection).

can someone tell me if there is something obvious that i am missing ? or maybe the way bridge works is maybe not what i am need ?

i would like to setup something that permit my guest in libvirt to be seen on the network as is it was a second physical computer.


thanks for all, and sorry for bad english.


Last edited by BakaO on Tue Aug 06, 2013 6:22 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 33040
Location: 56N 3W

PostPosted: Mon Aug 05, 2013 9:52 pm    Post subject: Reply with quote

BakaO,

You must not assign an IP address to eth0.
Put eth0 into the bridge and assign the IP address to br0

Notice the config_eth0="null" everywhere.

Code:
# This blank configuration will automatically use DHCP for any net.*
# scripts in /etc/init.d.  To create a more complete configuration,
# please review /usr/share/doc/openrc/net.example and save your configuration
# in /etc/conf.d/net (this file :]!).

# eth interfaces for firewall
# we don't want them getting IP addresses
# as they are being donated to bridges

config_eth0="null"
config_eth1="null"
config_eth2="null"
config_eth3="null"
config_eth4="null"

# when we use the Zyxel Router
# the big bad internet - we may not need an IP here as all trafic goes to the router.
bridge_br0="eth1"

# this is meaninless when we use ppp0 in the router
# as we get pppoe packets here and all we can do is pass them on to ppp0 in the router.

# Why do we have a defualt route ?
# thats the routers job - to route
config_br0="62.3.120.140/29"

# the DMZ
bridge_br1="eth2"
config_br1="192.168.10.254/24"

# wireless
bridge_br2="eth3"
config_br2="192.168.54.254/24"

# protected wired
bridge_br3="eth4"
config_br3="192.168.100.254/24"


This if from the bare metal install on my KVM host.
You may use dhcp to assign the IP to br0 if you wish.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
BakaO
n00b
n00b


Joined: 27 Sep 2003
Posts: 69

PostPosted: Tue Aug 06, 2013 9:19 am    Post subject: Reply with quote

Ok, will try that, thanks.

But I think I am understanding even less than before.

You want me to 'transfer' my configuration of eth0 on br0 and put 'null' in the config of eth0.


What if I want a second guest with a third ip on the network ?

- does both of the guests use the same birdge ?
- if not (br1) what is the configuration for that ?
Back to top
View user's profile Send private message
BakaO
n00b
n00b


Joined: 27 Sep 2003
Posts: 69

PostPosted: Tue Aug 06, 2013 6:22 pm    Post subject: Reply with quote

Ok, so I have applyied the advices of NeddySeagoon, and everything worked well as exected.


Thansk for all.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 33040
Location: 56N 3W

PostPosted: Tue Aug 06, 2013 6:45 pm    Post subject: Reply with quote

BakaO,

Well I cheat a little, I use libvirtd and virt-manager for managing my VMs.
What you don't see in my bare metal network setup are the tun/tap interfaces added to the bridges when the VMs start. Inside the VMs these appear as ethX devices. libvirtd and virt-manager between them hide this.

Both guests have different IP addresses on the same bridge.

Think of a bridge lake a network hub - not like a switch. A hub is dumb - it sends all traffic to all ports.
When you put eth0 into a bridge, you give this "hub" a real network connection. Its also an interface on your PC, so it behaves like eth0 but with more ports.
The extra ports on the "hub" are the tun/tap interfaces used by the VMs.

From a VM defintion XML file ...
Code:
    <interface type='bridge'>
      <mac address='52:54:00:72:c8:0d'/>
      <source bridge='br1'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </interface>

shows that this VM is connected to br1 for its networking.


From the process list the VM is run as
Code:
6 S qemu      3246     1  0  80   0 - 569630 ffffff Aug03 ?       00:35:02 /usr/bin/qemu-system-x86_64 -machine accel=kvm -name MasterClone \
-S -machine pc-0.14,accel=kvm,usb=off -m 1024 -smp 2,sockets=2,cores=1,threads=1 -uuid 59269ee5-ce35-c802-b3e9-2ec60e20d0b9 \
-no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/MasterClone.monitor,server,nowait \
-mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -boot menu=off -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
-drive file=/dev/vm/master,if=none,id=drive-virtio-disk0,format=raw -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x3,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \
-netdev tap,fd=19,id=hostnet0,vhost=on,vhostfd=20 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:72:c8:0d,bus=pci.0,addr=0x6 \
-chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -vnc 127.0.0.1:0 -vga cirrus -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4


The line starting -netdev tap in that huge command sets up the VM network interface.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum