I have 2 IPs from my ISP: one for my router (hAP ac2) and one for my home server.
I want my server to be connected to LAN as well as connected to the internet directly, using the IP from ISP.
There is only one Ethernet port on the server.
enp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.10.10.253 netmask 255.255.255.0 broadcast 10.10.10.255
vlan10: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 176.38.50.112 netmask 255.252.0.0 broadcast 176.39.255.255
default _gateway 0.0.0.0 UG 0 0 0 vlan10
10.10.10.0 0.0.0.0 255.255.255.0 U 0 0 0 enp2s0
Everything works as expected.
One interesting thing I noted is that upload speed on the server is limited to ~170 Mbps, if HW offload is turned on on ether2. With HW offload turned off on ether2, the upload speed is as expected (700+ Mbps).
So, the question is: how to configure the same in the right way?
With bridge VLAN filtering, bridge is used as a way to either configure hardware switch (on some/few devices) or emulate the same behaviour in software. You can then work with different vlans using vlan interfaces on bridge and it automatically takes care about tagging and untagging them on the right ports. It may be confusing at first, because you see WAN ethernet interface bridged with LAN ethernet interface(s) and it looks completely wrong. But it’s the filtering part that makes things separated. It’s actually really nice and simple once you understand it. The only problem is that support for HW offloading is quite limited on many devices. Hopefully it will be fixed in future where possible, but nobody knows when.
Sob,
Thank you for your answer. It looks like exactly what I want.
And you are right, adding all interfaces to one bridge is confusing at first look.
I’ll give it a try.
Thanks again!
IMHO the most confusing part is that bridge interface can be two things at once. First is interface for configuring the switch (either hardware or software), but also the bridge interface itself can be used as member port of selected vlan (depending on bridge’s pvid).
My limited experience is that its better not to involve bridge in anything beyond moving traffic around/
a. keep its default PVID of 1
b. do not assign any dhcp responsibilities
c. if a management VLAN is required assign it to an unused number 66, 99 etc…
I don’t know about hw switch way, I never really used it, except some test long time ago, and it was old switch without vlan support. I don’t know how it coexists with bridge, and I have no device I could test it with.
For the other way you need tagged vlan also on bridge interface, i.e. tagged=ether2,br. It’s the confusing part, here the bridge is used as interface and it needs to know that vlan interface added on top of it can access this tagged vlan.