Ich habe mir die folgenden Dateien angelegt (Verbindung zur FritzBox):
Code: Alles auswählen
#### /etc/systemd/network/10-lan3.link
#### statische Konfiguration der Schnittstelle
#### Prio 1: Verbindung zur FritzBox; 2nd Card
#
[Match]
Type=ether
MacAddress=00:30:84:11:11:11
[Link]
Description=Schnittstelle auf 2nd Card zur FritzBox
NamePolicy=mac
Name=lan3
MACAddress=00:30:84:11:11:11
Code: Alles auswählen
#### /etc/systemd/network/10-lan3.network
#### Netzwerk in Richtung FritzBox
#### Prio 1, IP-Adresse
#
[Match]
Name=enp2s8
Type=ether
[Link]
Unmanaged=no
MACAddress=00:30:84:11:11:11
[Network]
Description=LAN3, FritzBox + mobile Geräte
DHCP=no
IPForward=yes
Address=192.168.178.0/24
Gateway=192.168.178.1
DNS=192.168.178.1 192.168.17.4
Domains=fritz.box Server.local
[Address]
Address=192.168.178.4/24
Code: Alles auswählen
#### /etc/systemd/network/12-lan1.link
#### statische Konfiguration der Schnittstelle
#### Prio 2, Schnittstelle: OnBoard zu den Clients
#
[Match]
Type=ether
MacAddress=50:e5:49:5a:5d:0d
[Link]
Description=OnBoard-Schnittstelle zu Walli2, Brother, ...
NamePolicy=mac
Name=lan1
MACAddress=50:e5:49:22:22:22
Code: Alles auswählen
#### /etc/systemd/network/12-lan1.network
#### Netzwerk in Richtung Walli2
#### Prio 2, IP-Adresse, default gateway
#
[Match]
Name=enp3s0
Type=ether
[Link]
Unmanaged=no
MACAddress=50:e5:49:22:22:22
[Network]
Description=LAN1, Clients, Drucker, ...
DHCP=no
IPForward=yes
Address=192.168.17.0/24
#Gateway=192.168.178.1
#DNS=192.168.17.4 192.168.178.1
#Domains=Server.local fritz.box
[Address]
Address=192.168.17.4/24
[Route]
Type=unicast
Gateway=192.168.178.1
Code: Alles auswählen
ip addr show |grep -w inet
inet 127.0.0.1/8 scope host lo
inet 192.168.178.4/24 scope global enp2s8
inet 192.168.17.4/24 scope global enp3s0
ip route
default via 192.168.178.1 dev enp2s8
192.168.17.0/24 dev enp3s0 proto kernel scope link src 192.168.17.4
192.168.178.0/24 dev enp2s8 proto kernel scope link src 192.168.178.4
Die restlichen Dateien auf dem Server
Code: Alles auswählen
cat /etc/network/interfaces
auto lo
iface lo inet loopback
Code: Alles auswählen
systemctl status systemd-networkd --no-pager
● systemd-networkd.service - Network Service
Loaded: loaded (/lib/systemd/system/systemd-networkd.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2022-07-29 17:11:28 UTC; 6h ago
TriggeredBy: ● systemd-networkd.socket
Docs: man:systemd-networkd.service(8)
Main PID: 3067437 (systemd-network)
Status: "Processing requests..."
Tasks: 1 (limit: 18540)
Memory: 1.1M
CPU: 471ms
CGroup: /system.slice/systemd-networkd.service
└─3067437 /lib/systemd/systemd-networkd
Code: Alles auswählen
[Network]
#SpeedMeter=no
#SpeedMeterIntervalSec=10sec
#ManageForeignRoutes=yes
[DHCP]
#DUIDType=vendor
#DUIDRawData=
Die Einstellungen auf einem Client sind
Code: Alles auswählen
ip addr show |grep -w inet
inet 127.0.0.1/8 scope host lo
inet 192.168.17.2/24 brd 192.168.17.255 scope global enp2s0
inet 10.162.8.1/24 scope global pan1
ip route
default via 192.168.17.4 dev enp2s0 onlink
10.162.8.0/24 dev pan1 proto kernel scope link src 10.162.8.1
192.168.17.0/24 dev enp2s0 proto kernel scope link src 192.168.17.2
Code: Alles auswählen
traceroute -m6 192.168.178.1
traceroute to 192.168.178.1 (192.168.178.1), 6 hops max, 60 byte packets
1 Server (192.168.17.4) 0.246 ms 0.193 ms 0.154 ms
2 * * *
3 * * *
4 * * *
5 * * *
6 * * *
Kann jemand einen Fehler entdecken?
Nachtrag, ausgeführt auf dem Server:
Code: Alles auswählen
cat /proc/sys/net/ipv4/ip_forward
1