一条ACL控制RIP接收条目

实验目的:通过一条访问控制列表让运行RIP版本2的R2只能接收到运行RIP版本2的R1六个环回口中的偶数条目。
 
Router 1上的配置如下:
Router>
Router>
Router>en
Router#conf t
Router(config)#host R1
R1(config)#inte fa0/0
R1(config-if)#ip add 192.168.1.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#exit
R1(config)#inte lo 1
R1(config-if)#ip add 199.100.1.1 255.255.255.0
R1(config-if)#exit
R1(config)#inte lo 2
R1(config-if)#ip add 199.100.2.1 255.255.255.0
R1(config-if)#exit
R1(config)#inte lo3
R1(config-if)#ip add 199.100.3.1 255.255.255.0
R1(config-if)#exit
R1(config)#inte lo 4
R1(config-if)#ip add 199.100.4.1 255.255.255.0
R1(config-if)#exit
R1(config)#inte lo 5
R1(config-if)#ip add 199.100.5.1 255.255.255.0
R1(config-if)#exit
R1(config)#inte lo 6
R1(config-if)#ip add 199.100.6.1 255.255.255.0
R1(config-if)#exit
R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#no auto-summary
R1(config-router)#net 192.168.1.0
R1(config-router)#net 199.100.1.0
R1(config-router)#net 199.100.2.0
R1(config-router)#net 199.100.3.0
R1(config-router)#net 199.100.4.0
R1(config-router)#net 199.100.5.0
R1(config-router)#net 199.100.6.0
R1(config-router)#exit
R1(config)#access-list 1 permit 199.100.0.0 0.0.254.255
R1(config)#router rip
R1(config-router)#distribute-list 1 out fa0/0
R1(config-router)#exit
R1(config)#do sh run
Building configuration...
Current configuration : 1200 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
ip cef
!
!
!
!
!        
interface Loopback1
 ip address 199.100.1.1 255.255.255.0
!
interface Loopback2
 ip address 199.100.2.1 255.255.255.0
!
interface Loopback3
 ip address 199.100.3.1 255.255.255.0
!
interface Loopback4
 ip address 199.100.4.1 255.255.255.0
!
interface Loopback5
 ip address 199.100.5.1 255.255.255.0
!
interface Loopback6
 ip address 199.100.6.1 255.255.255.0
!
interface FastEthernet0/0
 ip address 192.168.1.1 255.255.255.0
 duplex auto
 speed auto
!        
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
router rip
 version 2
 network 192.168.1.0
 network 199.100.1.0
 network 199.100.2.0
 network 199.100.3.0
 network 199.100.4.0
 network 199.100.5.0
 network 199.100.6.0
 distribute-list 1 out FastEthernet0/0
 no auto-summary
!
ip http server
ip classless
!
!
access-list 1 permit 199.100.0.0 0.0.254.255
!
line con 0
 transport preferred all
 transport output all
line aux 0
 transport preferred all
 transport output all
line vty 0 4
!
end
 
Router 2上的配置如下:
Router>en
Router#conf t
Router(config)#host R2
R2(config)#inte fa0/0
R2(config-if)#ip add 192.168.1.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#exit
R2(config)#router rip
R2(config-router)#version 2
R2(config-router)#no au
R2(config-router)#net 192.168.1.0
R2(config-router)#exit
R2(config)#do sh run
Building configuration...
Current configuration : 630 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
ip cef
!
!
!
!
!        
interface FastEthernet0/0
 ip address 192.168.1.2 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
router rip
 version 2
 network 192.168.1.0
 no auto-summary
!
ip http server
ip classless
!
!
!
line con 0
 transport preferred all
 transport output all
line aux 0
 transport preferred all
 transport output all
line vty 0 4
!
end
通过查看路由表可以看到实验目的已达到。
 

你可能感兴趣的:(职场,休闲,rip)