0

As part of a bigger task I'm trying to build a simple setup:

A linux pc 1 (ubuntu) connected to another linux pc 2 wired, and to another device wirelessly.

The device and pc 2 should be able to ping each other using vlan bridging.

I've did the following:
On pc 1:
After stopping network-manager.
Made sure 8021q is loaded (lsmod | grep 8021q), it is loaded.
ifconfig eno1 up
ifconfig wlp2s0 up
(connected device to wlp2s0 using hostapd - assigned it static ip 192.168.1.120)
(connected device to eno1 - assigned it static ip 192.168.1.100)
ip link add link eno1 name eno1.19 type vlan id 19
ip link add link wlp2s0 name wlp2s0.19 type vlan id 19
ifconfig eno1 up
ifconfig wlp2s0 up
brctl addbr br-lan
ifconfig br-lan 192.168.1.1
ifconfig br-lan up
brctl addif br-lan eno1.19
brctl addif br-lan wlp2s0.19

Now I am trying to ping pc2 using the device, however I have no ping from any side.

Obviously, I'm doing something wrong here, and maybe misunderstanding how those commands work, can you please help me out here?

BTW
I have also tried using bridge vlan:
bridge vlan add vid 19 add eno1
However I received not supported, any idea why?

  • I do not see where VLANs com into play. Most end-device do not understand VLAN tags, and VLANs are not used on Wi-Fi because we use SSIDs for Wi-Fi instead of VLANs. You run separate VLANs to the WAP, where the WAP uses each VLAN for a separate SSID. VLANs are only used where you need to separate broadcast domains in a single device, e.g. ethernet switch. – Ron Maupin Jan 25 at 16:57
  • This is old, I have actually solved it a while back, will answer it soon. – dani39 Jan 25 at 17:05
0

I have solved it.

I had the mistaken idea that vlan is added when moving from regular netdev to a vlan netdev, the opposite is the truth.
vlan is added when the packet move from the vlan netdev to the regular one, it is removed when the packet is moving from the regular netdev to the vlan one.
The point of the test was to varify the pc (1) did in-fact had vlan ability, adding and removing.
To do so another test can be used, using 2 virtual netdevs - wlan0, wlan1 (from mac80211_hwsim), adding them both vlan 19 netdevs.
them do the following bridges:
bridge1 - wlp2s0 with wlan0.19
bridge2 - wlan1 and wlan0
bridge3 - wlan1.19 and eno1
Now the packet will arive in wlp2s0, move to wlan0 (with vlan), move to wlan1 (with vlan), then to wlan1.19 (no vlan) and to eno1, out to the device.
A sniffer may be used to check the behavior is as expected.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.