How to set up VLAN interfaces (IEEE 802.1Q) using the NetworkManager; e.g. in Archlinux…
Generally, the NetworkManager applet in XFCE4 (or Gnome, KDE, etc.) is pretty straightforward to achieve all the following (manual) steps in GUI. However, in case of an error, uncertainty, or just to follow the desire to have everything under control, the following steps should help to fulfil the same.
The first assumption is to prevent Udev to rename the network interfaces by:
ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules
The second assumption is that there exist two interfaces
eth1 which are assumed to be renamed to
wan. In this case however, the proccess will be handled by the NetworkManager.
The third assumption is that the
lan interface is a native Ethernet link. On the other hand, the
wan requires the IEEE 802.1Q frame tagging for each IPv4 (
wan4 subinterface) and IPv6 (
wan6 subif) connnectivity.
Make sure, the NetworkManager, nor the DHCP services are not running. i.e.:
systemctl stop NetworkManager.service systemctl stop dhcpcd.service systemctl stop dhcpcd@.service
Get the UUID, which comes with the NetworkManager, for each interface using:
nmcli con status
Create a configuration file for lan in
[802-3-ethernet] duplex=full mac-address=aa:bb:cc:dd:ee:ff [connection] id=LAN uuid=abcdef01-2345-6789-abcd-ef0123456789 type=802-3-ethernet timestamp=1389359785 [ipv6] method=ignore [ipv4] method=manual dns=18.104.22.168;22.214.171.124; address1=192.168.0.5/24,192.168.0.1 route1=192.168.1.0/24,192.168.0.1,1 never-default=true
Now, the same for wan in
[802-3-ethernet] duplex=full mac-address=00:01:02:03:04:05 [connection] id=WAN uuid=01234567-89ab-cdef-0123-456789abcdef type=802-3-ethernet timestamp=1388649970 [ipv6] method=link-local [ipv4] method=disabled
Now, the same for wan4 in
[connection] id=WAN4 uuid=01234567-89ab-cdef-0123-456789abcdef type=vlan timestamp=1388656952 [ipv6] method=ignore [vlan] interface-name=wan4 parent=wan id=444 [ipv4] method=manual dns=126.96.36.199;188.8.131.52; address1=184.108.40.206/24,220.127.116.11
And the same for wan6 in
[connection] id=WAN6 uuid=01234567-89ab-cdef-0123-456789abcdef type=vlan timestamp=1388656952 [ipv6] method=manual address1=dead:beef:cafe:1::2/64,dead:beef:cafe:1::1 [vlan] interface-name=wan6 parent=wan id=666 [ipv4] method=link-local
It is obvious, that the DNS setup in
/etc/resolv.conf is not required, as in this case, the proccess will be handled by the NetworkManager.
That’s pretty much it. As the NetworkManager will take care of everything, the only thing that remains is to make it run:
systemctl start NetworkManager.service
If everything works as desired, the DHCP daemon is not needed anymore. Thus, make sure it is not started during the system boot:
systemctl disable dhcpcd.service systemctl disable dhcpcd@.service