思科路由器靜態配置例項

  小編為大家介紹,歡迎大家閱讀。

  主機1 TCP/IP配置:IP地址為10.0.0.1 /8

  主機2 TCP/IP配置:IP地址為60.0.0.1 /8

  Router 1配置資訊:

  router>enable

  router#config terminal

  routerconfig#interface f 0/0

  routerconfig-if#ip address 10.0.0.2 255.0.0.0

  routerconfig-if#no shutdown

  routerconfig-if#exit

  routerconfig#interface f 0/1

  routerconfig-if#ip address 20.0.0.1 255.0.0.0

  routerconfig-if#no shutdown

  routerconfig-if#exit

  routerconfig#interface s 1/0

  routerconfig-if#ip address 30.0.0.1 255.0.0.0

  routerconfig-if#no shutdown

  routerconfig-if#exit

  routerconfig#ip route 40.0.0.0 255.0.0.0 20.0.0.2 注:目標網段+子網掩碼+下一跳地址

  routerconfig#ip route 50.0.0.0 255.0.0.0 30.0.0.2 注:目標網段+子網掩碼+下一跳地址

  routerconfig#end

  router#write

  Router 2配置資訊:

  router>enable

  router#config terminal

  routerconfig#interface f 0/0

  routerconfig-if#ip address 20.0.0.2 255.0.0.0

  routerconfig-if#no shutdown

  routerconfig-if#exit

  routerconfig#interface f 0/1

  routerconfig-if#ip address 40.0.0.1 255.0.0.0

  routerconfig-if#no shutdown

  routerconfig-if#exit

  routerconfig#ip route 10.0.0.0 255.0.0.0 20.0.0.1

  routerconfig#ip route 60.0.0.0 255.0.0.0 40.0.0.2

  routerconfig#end

  router#write

  Router 3配置資訊:ccie認證

  router>enable

  router#config terminal

  routerconfig#interface f 0/0

  routerconfig-if#ip address 30.0.0.2 255.0.0.0

  routerconfig-if#no shutdown

  routerconfig-if#exit

  routerconfig#interface f 0/1

  routerconfig-if#ip address 50.0.0.1 255.0.0.0

  routerconfig-if#no shutdown

  routerconfig-if#exit

  routerconfig#ip route 10.0.0.0 255.0.0.0 30.0.0.1

  routerconfig#ip route 60.0.0.0 255.0.0.0 50.0.0.2

  routerconfig#end

  router#write

  Router 4配置資訊:

  router>enable

  router#config terminal

  routerconfig#interface f 0/0

  routerconfig-if#ip address 40.0.0.2 255.0.0.0

  routerconfig-if#no shutdown

  routerconfig-if#exit

  routerconfig#interface f 0/1

  routerconfig-if#ip address 50.0.0.2 255.0.0.0

  routerconfig-if#no shutdown

  routerconfig-if#exit

  routerconfig#interface s 1/0

  routerconfig-if#ip address 60.0.0.2 255.0.0.0

  routerconfig-if#no shutdown

  routerconfig-if#exit

  routerconfig#ip route 20.0.0.0 255.0.0.0 40.0.0.1

  routerconfig#ip route 30.0.0.0 255.0.0.0 50.0.0.1

  routerconfig#end

  router#write