本文共 1203 字,大约阅读时间需要 4 分钟。
enable routing
Router(config)#ip routing
Router(config)#ip route 192.168.3.0 255.255.255.0 192.168.3.1Router(config)#ip route 172.16.0.0 255.255.255.0 172.16.0.254Router(config)#ip route 192.168.5.0 255.255.255.0 192.168.5.1
!--- The default route is configured and points to 192.168.1.2.ip route 0.0.0.0 0.0.0.0 192.168.1.2
remove route
no ip route 1.1.1.0 255.255.255.0 fastEthernet 0/0
save
copy run sta
debug rip
testBJ#debug ip rip
enable rip
Switch>en //进入特权模式Switch#conf t //进入全局模式Switch(config)#router rip //启动rip进程Switch(config-router)#network 192.168.1.0 //宣告网络192.168.1.0Switch(config-router)#ex //退出到全局模式
disable rip
Router(config)#no router rip
enable igrp
Router(config)#router igrp 200Router(config-router)#network 172.16.0.0
Disable IGRP
Router(config)#no router igrp 200
access-list 10 permit 192.168.1.0access-list 20 permit 192.168.2.0!int e0ip policy route-map nexthop!route-map nexthop permit 10match ip address 10set ip next-hop 192.168.1.1!route-map nexthop permit 20match ip address 20set ip next-hop 192.168.2.1!route-map nexthop permit 30