ich habe hier folgendes Szenario
Code: Alles auswählen
ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 52:54:00:12:b9:00 brd ff:ff:ff:ff:ff:ff
inet 175.45.170.246 peer 78.36.55.86/32 brd 175.45.170.246 scope global enp1s0
valid_lft forever preferred_lft forever
inet6 fe80::5054:ff:fe12:b900/64 scope link
valid_lft forever preferred_lft forever
3: enp7s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 52:54:00:8c:5f:83 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.246/24 brd 192.168.1.255 scope global enp7s0
valid_lft forever preferred_lft forever
inet6 fe80::5054:ff:fe8c:5f83/64 scope link
valid_lft forever preferred_lft forever
Code: Alles auswählen
netstat -rn
Kernel-IP-Routentabelle
Ziel Router Genmask Flags MSS Fenster irtt Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 enp7s0
78.36.55.86 0.0.0.0 255.255.255.255 UH 0 0 0 enp1s0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 enp7s0
Code: Alles auswählen
route del default gw 192.168.1.1 enp7s0 && route add default gw 78.36.55.86 enp1s0
Code: Alles auswählen
cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug enp1s0
iface enp1s0 inet static
address 175.45.170.246
netmask 255.255.255.255
pointopoint 78.36.55.86
gateway 78.36.55.86
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 213.122.100.100 9.9.9.9 192.168.1.1
dns-search example.tld
# The intern network interface
allow-hotplug enp7s0
iface enp7s0 inet static
address 192.168.1.246/24
gateway 192.168.1.1
dns-nameservers 213.122.100.100 9.9.9.9 192.168.1.1
dns-search example.tld
Gibt es eine Möglichkeit in der Config hier gleich das richtige Defaultrouting anzugeben? Und wenn ja, wie sähe die Syntax dazu aus?
Grüße
MPenzi