本文共 4844 字,大约阅读时间需要 16 分钟。
实验拓扑如下
实验最后通过traceroute或者查看路由表项判断是否正确以下为配置文件--------------------------------R1----------------------------------------R1>enR1#show runBuilding configuration...Current configuration : 1399 bytes
!! Last configuration change at 21:16:15 CST Sat Feb 16 2019!version 15.4service timestamps debug datetime msecservice timestamps log datetime msecno service password-encryption!hostname R1!boot-start-markerboot-end-marker!aqm-register-fnf!!no aaa new-modelclock timezone CST 8 0mmi polling-interval 60no mmi auto-configureno mmi pvcmmi snmp-timeout 180!!!!!!!
!!!ip cefno ipv6 cef!multilink bundle-name authenticated!!!!!!! !!redundancy!!! !!!!!!!!!!!!interface Loopback0ip address 1.1.1.1 255.255.255.0!interface Loopback1ip address 2.2.2.2 255.255.255.0!interface Ethernet0/0no ip addressshutdown!interface Ethernet0/1no ip addressshutdown!interface Ethernet0/2no ip addressshutdown!interface Ethernet0/3no ip addressshutdown!interface Serial1/0ip address 192.168.12.1 255.255.255.0serial restart-delay 0!interface Serial1/1no ip addressshutdownserial restart-delay 0!interface Serial1/2no ip addressshutdownserial restart-delay 0!interface Serial1/3no ip addressshutdownserial restart-delay 0!!router eigrp 100network 1.0.0.0network 2.0.0.0network 192.168.12.0!ip forward-protocol nd!!no ip http serverno ip http secure-server!!!!control-plane!!!!!!!!line con 0logging synchronousline aux 0line vty 0 4logintransport input none!!end--------------------------------R2----------------------------------------
R2#show run
Building configuration...Current configuration : 1418 bytes
!! Last configuration change at 21:13:58 CST Sat Feb 16 2019!version 15.4service timestamps debug datetime msecservice timestamps log datetime msecno service password-encryption!hostname R2!boot-start-markerboot-end-marker!aqm-register-fnf!!no aaa new-modelclock timezone CST 8 0mmi polling-interval 60no mmi auto-configureno mmi pvcmmi snmp-timeout 180!!!!!!!
!!!ip cefno ipv6 cef!multilink bundle-name authenticated!!!!!!! !!redundancy!!! !!!!!!!!!!!!interface Ethernet0/0no ip addressshutdown!interface Ethernet0/1no ip addressshutdown!interface Ethernet0/2no ip addressshutdown!interface Ethernet0/3no ip addressshutdown!interface Serial1/0ip address 192.168.12.2 255.255.255.0serial restart-delay 0!interface Serial1/1ip address 192.168.23.2 255.255.255.0ip ospf network point-to-pointserial restart-delay 0!interface Serial1/2no ip addressshutdown serial restart-delay 0!interface Serial1/3no ip addressshutdownserial restart-delay 0!!router eigrp 100network 192.168.12.0distance 130 192.168.12.1 0.0.0.0 2!router ospf 1network 192.168.23.2 0.0.0.0 area 0!ip forward-protocol nd!!no ip http serverno ip http secure-server!!! access-list 2 permit 2.2.2.0!control-plane!!!!!!!!line con 0logging synchronousline aux 0line vty 0 4logintransport input none!!end--------------------------------R3----------------------------------------
R3>en
R3#show runBuilding configuration...Current configuration : 1477 bytes
!version 15.4service timestamps debug datetime msecservice timestamps log datetime msecno service password-encryption!hostname R3!boot-start-markerboot-end-marker!aqm-register-fnf!!no aaa new-modelclock timezone CST 8 0mmi polling-interval 60no mmi auto-configureno mmi pvcmmi snmp-timeout 180!! !!!!!
!!!ip cefno ipv6 cef!multilink bundle-name authenticated!!!!!!!!! redundancy!!! !!!!!!!!!!!!interface Loopback0ip address 1.1.1.1 255.255.255.0ip ospf network point-to-point!interface Loopback1ip address 2.2.2.2 255.255.255.0ip ospf network point-to-point!interface Ethernet0/0no ip addressshutdown!interface Ethernet0/1no ip addressshutdown!interface Ethernet0/2no ip addressshutdown!interface Ethernet0/3no ip addressshutdown!interface Serial1/0no ip addressshutdownserial restart-delay 0!interface Serial1/1ip address 192.168.23.3 255.255.255.0ip ospf network point-to-pointserial restart-delay 0!interface Serial1/2no ip addressshutdownserial restart-delay 0!interface Serial1/3no ip addressshutdownserial restart-delay 0!router ospf 1network 1.1.1.0 0.0.0.255 area 0network 2.2.2.0 0.0.0.255 area 0network 192.168.23.3 0.0.0.0 area 0!ip forward-protocol nd!!no ip http serverno ip http secure-server!!!!control-plane!!!!!!!!line con 0logging synchronousline aux 0line vty 0 4logintransport input none!!end描述:distance 130 192.168.12.1 0.0.0.0 2
修改匹配acl表2并且路由来源是192.168.12.1的这条路由的AD值为130注:思科中ospf的AD值为110转载于:https://blog.51cto.com/14186275/2350987