Afin de résoudre certains problèmes il est parfois utile de connaître certaines commande de manipulation du réseau sous linux . D'ou le petit récapitulatif .
Connaitre la table de routage
- /*
- # ip route show
- 10.10.10.0/24 dev eth0 proto kernel scope link src 10.10.10.11
- default via 10.10.10.254 dev eth0
- */
- /*
- # route -n
- Table de routage IP du noyau
- Destination Passerelle Genmask Indic Metric Ref Use Iface
- 10.8.0.2 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
- 10.10.20.0 10.8.0.2 255.255.255.0 UG 0 0 0 tun0
- 10.8.0.0 10.8.0.2 255.255.255.0 UG 0 0 0 tun0
- 10.10.1.0 10.8.0.2 255.255.255.0 UG 0 0 0 tun0
- 10.10.10.0 10.8.0.2 255.255.255.0 UG 0 0 0 tun0
- 88.191.127.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
- 0.0.0.0 88.191.127.1 0.0.0.0 UG 0 0 0 eth0
- */
Ajouter une route
- /*
- # ip route add 10.150.109.192/26 via 10.150.58.1 dev eth2
- # ip route add 10.150.109.192/26 via 10.150.58.1
- */
Sur certains systèmes
- /*
- # route add -net 10.150.109.192 netmask 255.255.255.192 gw 10.150.58.1
- # route add -net 10.150.109.192 netmask 255.255.255.192 dev eth0
- */
Supprimer une route
- /*
- # ip route del 10.150.109.192/26 via 10.150.58.1 dev eth2
- # route del -net 10.150.109.192 netmask 255.255.255.192 dev eth0
- */
Afficher les interfaces et les informations de bas niveau
- /*
- # ip link show
- 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
- link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
- 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
- link/ether c8:0a:a9:c8:e5:a7 brd ff:ff:ff:ff:ff:ff
- 3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
- link/ether c8:0a:a9:c8:e5:a8 brd ff:ff:ff:ff:ff:ff
- 4: dummy0: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
- link/ether f6:e1:76:73:d0:5a brd ff:ff:ff:ff:ff:ff
- 58: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 100
- link/[65534]
- */