Home | 简体中文 | 繁体中文 | 杂文 | 打赏(Donations) | ITEYE 博客 | OSChina 博客 | Facebook | Linkedin | 知乎专栏 | Search | Email

11.7. 路由协议

11.7.1. 静态路由

enable routing

Router(config)#ip routing
		
		
Router(config)#ip route 192.168.3.0 255.255.255.0 192.168.3.1
Router(config)#ip route 172.16.0.0 255.255.255.0 172.16.0.254
Router(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
			
		

11.7.2. RIP

enable rip

		
Switch>en            		//进入特权模式
Switch#conf t        		//进入全局模式
Switch(config)#router rip   //启动rip进程
Switch(config-router)#network 192.168.1.0    //宣告网络192.168.1.0
Switch(config-router)#ex    //退出到全局模式
		
		

disable rip

Router(config)#no router rip
		

11.7.3. IGRP

enable igrp

		
Router(config)#router igrp 200
Router(config-router)#network 172.16.0.0
		
		

Disable IGRP

		
Router(config)#no router igrp 200
		
		

11.7.4. PBR

access-list 10 permit 192.168.1.0
access-list 20 permit 192.168.2.0
!
int e0
ip policy route-map nexthop
!
route-map nexthop permit 10
match ip address 10
set ip next-hop 192.168.1.1
!
route-map nexthop permit 20
match ip address 20
set ip next-hop 192.168.2.1
!
route-map nexthop permit 30