# How to setup Xen Bridge correctly

## Spargeltarzan

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".

```
 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"

```

```

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

```

```

richard-desktop ~ # brctl show

bridge name   bridge id      STP enabled   interfaces

br0      8000.d850e65284b3   no      eno1

```

In my nextcloud VM I added:

```

#

#  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

----------

## bbgermany

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:

```

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

----------

## Spargeltarzan

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.

```

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?

----------

## bbgermany

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:

```

config_br1="192.168.1.1 netmask 255.255.255.0 brd 192.168.1.255"

```

no further config.

greets, bb

----------

