To filter networks received in updates, use the distribute-list in command in address family or router configuration mode. To change or cancel the filter, use the no form of this command.
To suppress networks from being advertised in updates, use the distribute-list out command in address family or router configuration mode. To cancel this function, use the no form of this command.
ip address 192.168.0.1 255.255.255.0
!
interface Loopback1
ip address 192.168.1.1 255.255.255.0
!
interface Loopback2
ip address 192.168.2.1 255.255.255.0
!
interface Loopback3
ip address 192.168.3.1 255.255.255.0
!
description DCE,EIGRP 10,connected to R2's S1/0,ip 10.1.1.2/30
ip address 10.1.1.1 255.255.255.252
clock rate 9600
!
network 10.1.1.0 0.0.0.3
network 192.168.0.0 0.0.3.255
no auto-summary
!
description DTE,EIGRP 10,connected to R1's S1/1,ip 10.1.1.1/30
ip address 10.1.1.2 255.255.255.252
!
interface Serial1/1
description DCE,OSPF area 0,connected to R3's S1/0,ip 10.1.1.6/30
ip address 10.1.1.5 255.255.255.252
clock rate 9600
!
redistribute ospf 100 metric 200 100 0 1 1500
network 10.1.1.0 0.0.0.3
no auto-summary
!
router ospf 100
router-id 2.2.2.2
redistribute eigrp 10 metric 20 metric-type 1 subnets
network 10.1.1.4 0.0.0.3 area 0
distribute-list 1 out eigrp 10
!
access-list 1 deny 192.168.0.0 0.0.0.255
access-list 1 deny 192.168.1.0 0.0.0.255
access-list 1 deny 192.168.2.0 0.0.0.255
access-list 1 permit any
!
description DTE,OSPF area 0,connected to R2's S1/1,ip 10.1.1.5/30
ip address 10.1.1.6 255.255.255.252
!
interface Serial1/1
description DCE,OSPF area 0,connected to R4's S1/0,ip 172.16.1.2/24
ip address 172.16.1.1 255.255.255.0
clock rate 9600
!
router-id 3.3.3.3
network 10.1.1.4 0.0.0.3 area 0
network 172.16.1.0 0.0.0.255 area 0
distribute-list 10 in
!
access-list 10 deny 10.2.0.0 0.0.0.255
access-list 10 deny 10.2.1.0 0.0.0.255
access-list 10 permit any
!
ip address 10.2.0.1 255.255.255.0
!
interface Loopback1
ip address 10.2.1.1 255.255.255.0
!
interface Loopback2
ip address 10.2.2.1 255.255.255.0
!
interface Loopback3
ip address 10.2.3.1 255.255.255.0
!
description DTE,OSPF area 0,connected to R3's S1/1,ip 172.16.1.1/24
ip address 172.16.1.2 255.255.255.0
!
router-id 4.4.4.4
network 10.2.0.0 0.0.3.255 area 0
network 172.16.1.0 0.0.0.255 area 0
!
172.16.0.0/24 is subnetted, 1 subnets
D EX 172.16.1.0 [170/13337600] via 10.1.1.2, 00:23:50, Serial1/1
10.0.0.0/8 is variably subnetted, 6 subnets, 2 masks
D EX 10.2.1.1/32 [170/13337600] via 10.1.1.2, 00:14:04, Serial1/1
D EX 10.2.0.1/32 [170/13337600] via 10.1.1.2, 00:14:04, Serial1/1
D EX 10.2.3.1/32 [170/13337600] via 10.1.1.2, 00:14:04, Serial1/1
C 10.1.1.0/30 is directly connected, Serial1/1
D EX 10.2.2.1/32 [170/13337600] via 10.1.1.2, 00:14:04, Serial1/1
D EX 10.1.1.4/30 [170/13337600] via 10.1.1.2, 00:24:56, Serial1/1
C 192.168.0.0/24 is directly connected, Loopback0
C 192.168.1.0/24 is directly connected, Loopback1
C 192.168.2.0/24 is directly connected, Loopback2
C 192.168.3.0/24 is directly connected, Loopback3
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.1.0 is directly connected, Serial1/0
10.0.0.0/8 is variably subnetted, 6 subnets, 2 masks
C 10.2.0.0/24 is directly connected, Loopback0
C 10.2.1.0/24 is directly connected, Loopback1
C 10.2.2.0/24 is directly connected, Loopback2
O E1 10.1.1.0/30 [110/148] via 172.16.1.1, 00:14:56, Serial1/0
C 10.2.3.0/24 is directly connected, Loopback3
O 10.1.1.4/30 [110/128] via 172.16.1.1, 00:14:56, Serial1/0
O E1 192.168.3.0/24 [110/148] via 172.16.1.1, 00:14:56, Serial1/0
Sending 5, 100-byte ICMP Echos to 10.2.1.1, timeout is 2 seconds:
U.U.U //目标不可达
Success rate is 0 percent (0/5)
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.1.0 is directly connected, Serial1/1
10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
O 10.2.3.1/32 [110/65] via 172.16.1.2, 00:20:15, Serial1/1
O E1 10.1.1.0/30 [110/84] via 10.1.1.5, 00:20:15, Serial1/0
O 10.2.2.1/32 [110/65] via 172.16.1.2, 00:20:15, Serial1/1
C 10.1.1.4/30 is directly connected, Serial1/0
O E1 192.168.3.0/24 [110/84] via 10.1.1.5, 00:20:15, Serial1/0
(Link ID) Network/subnet number: 10.2.1.1
(Link Data) Network Mask: 255.255.255.255
Number of TOS metrics: 0
TOS 0 Metrics: 1
(Link ID) Network/subnet number: 10.2.0.1
(Link Data) Network Mask: 255.255.255.255
Number of TOS metrics: 0
TOS 0 Metrics: 1