Home | 簡體中文 | 繁體中文 | 雜文 | 打賞(Donations) | ITEYE 博客 | OSChina 博客 | Facebook | Linkedin | 知乎專欄 | Search | Email

5.7. 路由協議

5.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
			
		

5.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
		

5.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
		
		

5.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