# two bridges one nic



## Sebastian (May 10, 2018)

Hey, 

I'm playing around with vxlan , but I don't get my basic setup working. 

I only want to add one physical nic to two bridges. 


```
|--- Bridge0
NIC ---- |
         |--- Bridge1
```

But if I want to add the NIC to the second bridge I'm getting an error.

ifconfig: BRDGADD ix0: Device busy 

I don't know if that should work... or do I have to use a vswitch for this kind of setup ?


----------



## VladiBG (May 10, 2018)

You can create a bridge without members.
`ifconfig bridge0 create`

then create a vxlan pseudo device and add it to the bridge if needed
`ifconfig vxlan create vxlanid 1 vxlanlocal 192.168.1.1 vxlanremote 192.168.1.2 inet 10.0.0.0/8
ifconfig bridge0 addm vxlan0`


----------



## Sebastian (May 19, 2018)

Thank you VladiBG , that is the point. You don't attach vxlan interface to a bridge like an epair interface. 

Everything what you need is something like this.


```
ifconfig vxlan20 create vxlanid 20 vxlanlocal 192.168.20.1 vxlandev ix0 vxlangroup 239.0.4.210
ifconfig vxlan20 inet 192.168.20.10/24 up mtu 1450
ifconfig vxlan20
```

Sadly , my edge router does not support vxlan ... , even though it is based on freebsd.


----------



## VladiBG (May 19, 2018)

You need to think of the bridge as it's a virtual L2 switch inside your router. And the members are the interfaces connected to this virtual switch.
 My offices are connected through MPLS network that split the internet VLANs and internal VLANs between the offices but i'm using Cisco Routers and i don't have much experience with vxlans tunnels. Maybe you can try to get rid of L2 and try to connect your sites using L3 only. This will simplify your topology.  Or if you have enough processing power you can use L2TP/IPSEC to encrypt the end to end traffic depending of your requirements and bandwidth because if you have over several GB/s to encrypt is almost impossible without any hardware encryption module.


----------



## Sebastian (May 19, 2018)

I'm just labbing in my home network. It is only to get in touch with the technology  . VXLAN toally overpowered for my case , but I had a use where I need vlans in my home lab, but I thought I don't want to configure vlans on my switches and than I stumbled over vxlan.


Mabye I will buy an APU Board and run freebsd on it so I can play arround a litte bit, but there pretty expensive so I'm not sure if I spend 200$ just for fun.


----------



## VladiBG (May 19, 2018)

you can use GNS3


----------



## Sebastian (May 19, 2018)

Right, but for my purpose I have to use real hardware. 
I want to  bridge a vm with a special firmware to one of my ap's. This firmware allows people in germany to create an open wifi network. 

But thank you for pointing me to this direction . Never played with servers in GS3 or UNL . But from the past I know that layer 2 tunneling stuff is not working well in this kind of enviroments. Did run a vxlan lab in gns3 ?


----------



## VladiBG (May 19, 2018)

Yes you can have vm in GNS3 lab. vxlan is L2 frame encapsulated in UDP datagram. If you can afford to buy a real hardware is always better.


----------

