分布列表1
R1#show ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES unset administratively down down
Serial1/0 unassigned YES unset administratively down down
Serial1/1 172.16.12.1 YES manual up up
Serial1/2 unassigned YES unset administratively down down
Serial1/3 unassigned YES unset administratively down down
Loopback0 1.1.1.1 YES manual up up
R2#show ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES unset administratively down down
Serial1/0 172.16.12.2 YES manual up up
Serial1/1 172.16.23.2 YES manual up up
Serial1/2 unassigned YES unset administratively down down
Serial1/3 unassigned YES unset administratively down down
Loopback0 2.2.2.2 YES manual up up
R3#show ip interface bri
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES unset administratively down down
Serial1/0 172.16.23.3 YES manual up up
Serial1/1 unassigned YES unset administratively down down
Serial1/2 unassigned YES unset administratively down down
Serial1/3 unassigned YES unset administratively down down
Loopback0 3.3.3.3 YES manual up up
R1 :
config t
router eigrp 100
no auto-summary
net 172.16.12.0 0.0.0.255
net 1.1.1.1 0.0.0.0
R2:
config t
router eigrp 100
no auto-summary
net 172.16.12.0 0.0.0.255
net 172.16.23.0 0.0.0.255
net 2.2.2.2 0.0.0.0
R3
config t
no aut-summary
net 172.16.23.0 0.0.0.255
net 3.3.3.3 0.0.0.0
(1):在R2上实行distribute-list,配置如下:
config t
access-list 1 permit 1.1.1.1 0.0.0.0
router eigrp 100
distribute-list 1 permit out s1/1
如下是R2 R3的路由表:
R2#show ip route
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
D 1.1.1.1 [90/2297856] via 172.16.12.1, 00:07:23, Serial1/0
2.0.0.0/32 is subnetted, 1 subnets
C 2.2.2.2 is directly connected, Loopback0
3.0.0.0/32 is subnetted, 1 subnets
D 3.3.3.3 [90/2297856] via 172.16.23.3, 00:10:13, Serial1/1
172.16.0.0/24 is subnetted, 2 subnets
C 172.16.23.0 is directly connected, Serial1/1
C 172.16.12.0 is directly connected, Serial1/0
R3#show ip route
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
D 1.1.1.1 [90/2809856] via 172.16.23.2, 00:08:25, Serial1/0
3.0.0.0/32 is subnetted, 1 subnets
C 3.3.3.3 is directly connected, Loopback0
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.23.0 is directly connected, Serial1/0
//看到没有,2.2.2.2这条路由不存在了呀,被distribute-list 给隐含DENY掉了
(2),在R1上实行distribut-list ,允许3.3.3.3的路由通过.
R1:
config t
access-list 1 permit 3.3.3.3 0.0.0.0
router eigrp 100
distribute-list 1 in s1/1
如下是其路由表:
R1#show ip route
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
C 1.1.1.1 is directly connected, Loopback0
3.0.0.0/32 is subnetted, 1 subnets
D 3.3.3.3 [90/2809856] via 172.16.12.2, 00:12:47, Serial1/1
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.12.0 is directly connected, Serial1/1
只有3.3.3.3通过了,2.2.2.2被干掉了.