-
-
# Use of ip command
-
ip route add 192.168.55.0/24 via 192.168.1.254 dev eth1
-
route add -net 192.168.55.0 netmask 255.255.255.0 gw 192.168.1.254 dev eth1
-
#———————————————-
-
# Red Hat/Fedora Linux Static route file
-
#———————————————-
-
cat /etc/sysconfig/network-scripts/route-eth0
-
GATEWAY0=192.168.1.254
-
NETMASK0=255.255.255.0
-
ADDRESS0=192.168.55.0
-
GATEWAY1=10.164.234.112
-
NETMASK1= 255.255.255.240
-
ADDRESS1=10.164.234.132
-
#————————————
-
# Debian Linux static routes file
-
#————————————
-
cat /etc/network/interface
-
auto eth0
-
iface eth0 inet static
-
address 192.168.1.2
-
netmask 255.255.255.0
-
gateway 192.168.1.254
-
up route add -net 192.168.2.0 netmask 255.255.255.0 gw 192.168.2.1
-
down route del -net 192.168.2.0 netmask 255.255.255.0 gw 192.168.2.1
-
-
-
# Pour ajouter une route vers le réseau 192.168.1.1/24 à travers la passerelle 172.10.10.1
-
route add 192.168.1.1 mask 255.255.255.0 172.10.10.1
-
# Pour que la route soit permanente :
-
route -p add 192.168.1.1 mask 255.255.255.0 172.10.10.1
-
-
-
#ajouter une route par defaut
-
route add default gw 192.168.0.1
-
#afficher les routes
-
route -n
-
# supprimer une route
-
route del -net 192.168.0.1/24
“route” related tags
spirit’s tags
-