00-guestvlan.netdev
[NetDev]
Name=guestvlan
Kind=vlan
[VLAN]
Id=9
10-eno0.network
[Match]
Name=eno0
[Network]
# Dont be mistaken, this just tells the main device to allow this VLAN, its NOT the VLAN-Interface, we are on main eno0
VLAN=guestvlan
DHCP=ipv4
#Domains=domain.tld
#DNSSearchDomains=domain.tld
[DHCP]
UseDomains=true
# Seems still broken, wait for fix
#[DHCPv4]
#RequestOptions=119
#[Route]
#Destination=0.0.0.0/0
#Gateway=_dhcpv4
#Metric=1260
11-guestvlan.network
[Match]
Name=guestvlan
[Network]
Description=VLAN Interface for guest
DHCP=ipv4
#DNS=10.127.0.1
#Domains=guest
[DHCP]
UseDomains=true
[DHCPv4]
# If you want DHCP, use:
UseRoutes=false
# The Address will create the scope link route which catches OutgoingInterface=
# ip route show table all
#[Address]
#Address=10.127.1.1/16
# Custom Routing
# A lower Metric NUMBER will be preferred
# + A 1024 metric rule is a systemd artifact rule
# A lower priority NUMBER will be preffered
# guest -> world
[Route]
Gateway=10.127.0.1
Table=127
Metric=1270
# Ping-traffic
# The outgoing interface is only available for packets originating from local sockets that are bound to a device.
# -- Which is why we use this for pings, as its ping -I
[RoutingPolicyRule]
OutgoingInterface=guestvlan
# if you set From= here you will force replies to tvs asking for upnp and other clients to go out through the gateway, so dont do that!
#From=10.127.1.1/32
Protocol=icmp
Table=127
Priority=5000
# internal <-> internal subnet unicast
[RoutingPolicyRule]
From=10.127.1.1/32
To=10.127.0.0/16
Table=main
Priority=8000
# guest <-> guest RTP Music
# keep RTP Music on VLAN.
# !!!We skip the From= here as pulseaudio will add itself to eno0 if we do
#
[RoutingPolicyRule]
#From=10.127.1.1/132
To=239.127.1.1/32
Table=127
Priority=8000
# keeps SSDP / upnp discovery in main though # ditto for table = main
[RoutingPolicyRule]
From=10.127.1.1/32
To=239.255.255.250/32
#Protocol=udp
#DestinationPort=1900
Table=main
Priority=8000
# internal <-> subnet multicast catchall
[RoutingPolicyRule]
#OutgoingInterface=guestvlan
From=10.127.1.1/32
To=224.0.0.0/4
Table=main
Priority=9000
# Catch all for interface
[RoutingPolicyRule]
From=10.127.1.1/32
#OutgoingInterface=guestvlan
Table=127
Priority=10000
[RoutingPolicyRule]
#From=10.127.1.1/32
OutgoingInterface=guestvlan
Table=127
Priority=10000
# Note: You don't need to edit /etc/iproute2/rt_tables. systemd-networkd works perfectly fine with table numbers directly.