
Bei jedem Neustart des Servers oder "systemctl restart network" muss ich die statischen Routen hinzufügen
Rhel 7.8
ip route add 192.168.1.1 dev ens192 proto static scope link metric 100
ip route add 192.168.2.0/24 dev ens192 proto kernel scope link src 192.168.2.11 metric 100
ip route add default via 192.168.1.1 dev ens192 proto static metric 100
Nachfolgend ist aufgeführt, was hinzugefügt wird:
# ip route
169.254.0.0/16 dev ens192 scope link metric 1002
172.16.2.0/24 dev ens192 proto kernel scope link src 172.16.2.11
Wie mache ich die Route statisch
# ip route
default via 172.16.1.1 dev ens192 proto static metric 100
172.16.1.1 dev ens192 proto static scope link metric 100
172.16.2.0/24 dev ens192 proto kernel scope link src 172.16.2.11 metric 100
Antwort1
Das Hinzufügen von IP-Routen über die Befehlszeile ist nur temporär. Um die Routen dauerhaft hinzuzufügen, müssen Sie sie den Schnittstellendateien in hinzufügen /etc/sysconfig/network-scripts/
.