# route add  -net IP   netmask 掩码  dev    eth0
  # route add  -net IP   netmask  掩码  gw    网关IP
  # route add  -net  IP/24   dev  eth1

  # route add default gw IP

 

1、配置eth0的IP,同时激活设备:
  # ifconfig eth0 192.168.4.1 netmask 255.255.255.0  up

2、激活(禁用)设备
  # ifconfig  eth0   up(down)

3、route命令指定路由

  添加到主机路由
  # route add –host 192.168.4.2 dev eth0:1
  # route add –host 192.168.4.1 gw  192.168.4.250

  删除到主机路由
  # route  del –host 192.168.4.2 dev eth0:1
  # route  del –host 192.168.4.1 gw  192.168.4.250

 添加默认网关
  # route add default  gw  192.168.1.1

添加网络路由
route add -net 192.168.20.0 netmask 255.255.255.0 gw 192.168.10.1
查看路由状态
route -n
删除网络路由
route del -net 192.168.20.0 netmask 255.255.255.0