Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...






ip route help

Add a new route:

ip route add default via 192.168.0.1 dev eth0
add default

ip route add 10.0.0.0/8 via via 192.168.0.1 dev

add a route

ip route add 10.10.0.0/16 dev eth0

or

ip route add 10.1.0.0/16 dev eth0




Routing table



route man:
ip route

[root@centos66 ~]# ip route

192.9.200.0/24 dev eth1  proto kernel  scope link  src 192.9.200.1

169.254.0.0/16 dev eth1  scope link  metric 1003

Centos:

 ( install net-tools on ubuntu )
route -n

[root@centos66 ~]# route -n

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

192.9.200.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1

169.254.0.0     0.0.0.0         255.255.0.0     U     1003   0        0 eth1


route -nee

[root@centos66 ~]# route -nee

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface    MSS   Window irtt

192.9.200.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1     0     0      0

169.254.0.0     0.0.0.0         255.255.0.0     U     1003   0        0 eth1     0     0      0



...