Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to setup Xen Bridge correctly
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
Spargeltarzan
Guru
Guru


Joined: 23 Jul 2017
Posts: 300

PostPosted: Sun Jul 30, 2017 11:56 am    Post subject: How to setup Xen Bridge correctly Reply with quote

Hello,

I worked through the Xen Section to setup the Xen Bridge, but I struggle to understand and set the right config.

I do not understand what XX means in the config_br0 from the documentation, I tried replace it with 192.168.0.100 as well as in routes_br0="default via 192.168.0.100".


Code:
 cat /etc/conf.d/net
richard@richard-desktop ~ $ cat /etc/conf.d/net
config_eno1="null"

# configure bridge to replace eno1 on dom0. Make sure the netmask for the bridge includes ip addresses of all your domUs!
bridge_br0="eno1"

config_br0="192.168.0.100 netmask 255.255.255.0 brd 192.168.255.255"

routes_br0="default via 192.168.0.100"
mac_br0="00:16:3e:5b:XX:XX"

# bridge options to make interface come up immediately
bridge_stp_state_br0="0"
bridge_forward_delay_br0="0"
bridge_hello_time_br0="1000"

rc_net_br0_need="net.eno1"
rc_net_br0_provide="!net"



Code:

richard@richard-desktop ~ $ ifconfig -a
br0: flags=4354<BROADCAST,PROMISC,MULTICAST>  mtu 1500
        ether d8:50:e6:52:84:b3  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::da50:e6ff:fe52:84b3  prefixlen 64  scopeid 0x20<link>
        ether d8:50:e6:52:84:b3  txqueuelen 1000  (Ethernet)
        RX packets 5  bytes 1902 (1.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 12  bytes 976 (976.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 20  memory 0xf7c00000-f7c20000 

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Lokale Schleife)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

sit0: flags=128<NOARP>  mtu 1480
        sit  txqueuelen 1  (IPv6-nach-IPv4)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp4s0: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 24:0a:64:1c:8c:79  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0



Code:

richard-desktop ~ # brctl show
bridge name   bridge id      STP enabled   interfaces
br0      8000.d850e65284b3   no      eno1


In my nextcloud VM I added:

Code:

#
#  Networking
#
dhcp        = 'dhcp'
vif         = [ 'bridge=br0' ]




NetworkManager is disabled. When I try to create the nextcloud VM I get a timeout in "A start job is running ffor Raise network interfaces..."
Further I would like to have Internet access from dom0 too, what do I need to add? How can I communicate (NFS, Samba) with my dom0, if no IP address will be assigned?

Many thanks in advance!
Regards,
Richard
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1792
Location: Oranienburg/Germany

PostPosted: Mon Jul 31, 2017 6:22 am    Post subject: Reply with quote

Hi,

The XX is a placeholder for your specific configuration of your network ip space for example.

the mac_br0 should be set to your mac-address of you ethernet interface, so in your case:

Code:

mac_br0="d8:50:e6:52:84:b3"


But this is only needed, if your bridge has switching macs according to added interfaces to bridge while booting (for example bridged openvpn config).

Don't forget to add net.eno1 and net.br0 to your runlevel.

greets, bb
_________________
1st: i5-4570, 16GB, 1.75TB
2nd: i5-4570, 16GB, 620GB
3rd: i5-4570, 16GB, 10,5TB
4th: Asus N61VN, 8GB, 240GB
5th: C2D T7200, 2GB, 16GB USB + NFS
Back to top
View user's profile Send private message
Spargeltarzan
Guru
Guru


Joined: 23 Jul 2017
Posts: 300

PostPosted: Tue Aug 01, 2017 9:58 pm    Post subject: Reply with quote

Many thanks, it works now!

I would like to add a second bridge for my Windows VM only, the Windows VM should be able to access Samba shares from Dom0, but should have no Internet access.

Do I still need to add eno1 in bridge_br1? My idea is to configure the bridge as shown, but remove the default gateway.

Code:

bridge_br1="eno1"

config_br1="192.168.0.101 netmask 255.255.255.0 brd 192.168.255.255"

--> remove this line: routes_br1="default via 192.168.0.100"


So dom0 has an own virtual network bridge with Windows VM for internal network only. Or any other, better idea how to solve this?
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1792
Location: Oranienburg/Germany

PostPosted: Wed Aug 02, 2017 5:18 am    Post subject: Reply with quote

Hi,

iirc you cannot add the same physical interface to two bridges (doesnt make sense either). You should just add a second bridge without the eno1 and assign a new ipaddress from a different range. Add the windows host to this bridge when creating the guest and let samba listen to the second bridge interface. this should do it. i would try the following:

Code:

config_br1="192.168.1.1 netmask 255.255.255.0 brd 192.168.1.255"


no further config.

greets, bb
_________________
1st: i5-4570, 16GB, 1.75TB
2nd: i5-4570, 16GB, 620GB
3rd: i5-4570, 16GB, 10,5TB
4th: Asus N61VN, 8GB, 240GB
5th: C2D T7200, 2GB, 16GB USB + NFS
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