這是最近做的一個實驗:
1,EIGRP和OSPF相互重分發。2,過濾某些不需要的路由。3,優化路由條目。
東西比較多,大家看的時候耐心點。如果有什麼不妥的地方還請大家給予指正!
R1#show run
Building configuration...
Building configuration...
Current configuration : 1389 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
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 10.10.4.1 255.255.255.240
!
interface Loopback1
ip address 10.10.4.17 255.255.255.240
!
interface Loopback2
ip address 10.10.4.33 255.255.255.240
!
interface Loopback3
ip address 10.10.4.49 255.255.255.240
!
interface Loopback4
ip address 10.10.4.65 255.255.255.240
!
interface FastEthernet0/0
ip address 1.1.1.1 255.255.255.0
duplex half
!
interface FastEthernet1/0
no ip address
shutdown
duplex auto
speed auto
!
interface FastEthernet1/1
no ip address
shutdown
duplex auto
speed auto
!
router eigrp 124
network 1.1.1.0 0.0.0.255
network 10.10.4.0 0.0.0.15
network 10.10.4.16 0.0.0.15
network 10.10.4.32 0.0.0.15
network 10.10.4.48 0.0.0.15
network 10.10.4.64 0.0.0.15
no auto-summary
!
ip classless
no ip http server
!
!
cdp timer 5
cdp holdtime 10
!
!
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
logging synchronous
transport preferred all
transport output all
stopbits 1
line aux 0
transport preferred all
transport output all
stopbits 1
line vty 0 4
login
transport preferred all
transport input all
transport output all
!
!
end
!
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
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 10.10.4.1 255.255.255.240
!
interface Loopback1
ip address 10.10.4.17 255.255.255.240
!
interface Loopback2
ip address 10.10.4.33 255.255.255.240
!
interface Loopback3
ip address 10.10.4.49 255.255.255.240
!
interface Loopback4
ip address 10.10.4.65 255.255.255.240
!
interface FastEthernet0/0
ip address 1.1.1.1 255.255.255.0
duplex half
!
interface FastEthernet1/0
no ip address
shutdown
duplex auto
speed auto
!
interface FastEthernet1/1
no ip address
shutdown
duplex auto
speed auto
!
router eigrp 124
network 1.1.1.0 0.0.0.255
network 10.10.4.0 0.0.0.15
network 10.10.4.16 0.0.0.15
network 10.10.4.32 0.0.0.15
network 10.10.4.48 0.0.0.15
network 10.10.4.64 0.0.0.15
no auto-summary
!
ip classless
no ip http server
!
!
cdp timer 5
cdp holdtime 10
!
!
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
logging synchronous
transport preferred all
transport output all
stopbits 1
line aux 0
transport preferred all
transport output all
stopbits 1
line vty 0 4
login
transport preferred all
transport input all
transport output all
!
!
end
R2#show run
Building configuration...
Building configuration...
Current configuration : 1064 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
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 10.10.2.1 255.255.255.0
!
interface FastEthernet0/0
ip address 1.1.1.2 255.255.255.0
duplex half
!
interface FastEthernet1/0
ip address 2.2.2.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet1/1
no ip address
shutdown
duplex auto
speed auto
!
router eigrp 124
network 1.1.1.0 0.0.0.255
network 2.2.2.0 0.0.0.255
network 10.10.2.0 0.0.0.255
no auto-summary
!
ip classless
no ip http server
!
!
cdp timer 5
cdp holdtime 10
!
!
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
logging synchronous
transport preferred all
transport output all
stopbits 1
line aux 0
transport preferred all
transport output all
stopbits 1
line vty 0 4
login
transport preferred all
transport input all
transport output all
!
!
end
!
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
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 10.10.2.1 255.255.255.0
!
interface FastEthernet0/0
ip address 1.1.1.2 255.255.255.0
duplex half
!
interface FastEthernet1/0
ip address 2.2.2.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet1/1
no ip address
shutdown
duplex auto
speed auto
!
router eigrp 124
network 1.1.1.0 0.0.0.255
network 2.2.2.0 0.0.0.255
network 10.10.2.0 0.0.0.255
no auto-summary
!
ip classless
no ip http server
!
!
cdp timer 5
cdp holdtime 10
!
!
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
logging synchronous
transport preferred all
transport output all
stopbits 1
line aux 0
transport preferred all
transport output all
stopbits 1
line vty 0 4
login
transport preferred all
transport input all
transport output all
!
!
end
R3#show run
Building configuration...
Building configuration...
Current configuration : 1400 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
ip address 3.3.3.1 255.255.255.0
duplex half
!
interface FastEthernet1/0
ip address 2.2.2.2 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet1/1
no ip address
shutdown
duplex auto
speed auto
!
router eigrp 124
redistribute ospf 1 metric 10000 100 255 1 1500 route-map o2e
network 2.2.2.0 0.0.0.255
no auto-summary
!
router ospf 1
log-adjacency-changes
summary-address 10.10.4.0 255.255.255.192
redistribute eigrp 124 subnets route-map test
network 3.3.3.0 0.0.0.255 area 0
!
ip classless
no ip http server
!
!
access-list 1 permit 10.10.4.64 0.0.0.15
access-list 2 permit 20.20.5.0 0.0.0.255
cdp timer 5
cdp holdtime 10
!
route-map test deny 10
match ip address 1
!
route-map test permit 20
!
route-map o2e deny 10
match ip address 2
!
route-map o2e permit 20
!
!
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
logging synchronous
transport preferred all
transport output all
stopbits 1
line aux 0
transport preferred all
transport output all
stopbits 1
line vty 0 4
login
transport preferred all
transport input all
transport output all
!
!
end
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
ip address 3.3.3.1 255.255.255.0
duplex half
!
interface FastEthernet1/0
ip address 2.2.2.2 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet1/1
no ip address
shutdown
duplex auto
speed auto
!
router eigrp 124
redistribute ospf 1 metric 10000 100 255 1 1500 route-map o2e
network 2.2.2.0 0.0.0.255
no auto-summary
!
router ospf 1
log-adjacency-changes
summary-address 10.10.4.0 255.255.255.192
redistribute eigrp 124 subnets route-map test
network 3.3.3.0 0.0.0.255 area 0
!
ip classless
no ip http server
!
!
access-list 1 permit 10.10.4.64 0.0.0.15
access-list 2 permit 20.20.5.0 0.0.0.255
cdp timer 5
cdp holdtime 10
!
route-map test deny 10
match ip address 1
!
route-map test permit 20
!
route-map o2e deny 10
match ip address 2
!
route-map o2e permit 20
!
!
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
logging synchronous
transport preferred all
transport output all
stopbits 1
line aux 0
transport preferred all
transport output all
stopbits 1
line vty 0 4
login
transport preferred all
transport input all
transport output all
!
!
end
R4#show run
Building configuration...
Building configuration...
Current configuration : 1059 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R4
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
ip address 3.3.3.2 255.255.255.0
duplex half
!
interface FastEthernet1/0
ip address 4.4.4.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet1/1
no ip address
shutdown
duplex auto
speed auto
!
router ospf 1
log-adjacency-changes
area 35 stub no-summary
area 35 range 20.20.0.0 255.255.248.0
network 3.3.3.0 0.0.0.255 area 0
network 4.4.4.0 0.0.0.255 area 35
!
ip classless
no ip http server
!
!
cdp timer 5
cdp holdtime 10
!
!
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
logging synchronous
transport preferred all
transport output all
stopbits 1
line aux 0
transport preferred all
transport output all
stopbits 1
line vty 0 4
login
transport preferred all
transport input all
transport output all
!
!
end
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R4
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
ip address 3.3.3.2 255.255.255.0
duplex half
!
interface FastEthernet1/0
ip address 4.4.4.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet1/1
no ip address
shutdown
duplex auto
speed auto
!
router ospf 1
log-adjacency-changes
area 35 stub no-summary
area 35 range 20.20.0.0 255.255.248.0
network 3.3.3.0 0.0.0.255 area 0
network 4.4.4.0 0.0.0.255 area 35
!
ip classless
no ip http server
!
!
cdp timer 5
cdp holdtime 10
!
!
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
logging synchronous
transport preferred all
transport output all
stopbits 1
line aux 0
transport preferred all
transport output all
stopbits 1
line vty 0 4
login
transport preferred all
transport input all
transport output all
!
!
end
R5#show run
Building configuration...
Building configuration...
Current configuration : 1529 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R5
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 20.20.1.1 255.255.255.0
ip ospf network point-to-point
!
interface Loopback1
ip address 20.20.2.1 255.255.255.0
ip ospf network point-to-point
!
interface Loopback2
ip address 20.20.3.1 255.255.255.0
ip ospf network point-to-point
!
interface Loopback3
ip address 20.20.4.1 255.255.255.0
ip ospf network point-to-point
!
interface Loopback4
ip address 20.20.5.1 255.255.255.0
ip ospf network point-to-point
!
interface FastEthernet0/0
no ip address
shutdown
duplex half
!
interface FastEthernet1/0
ip address 4.4.4.2 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet1/1
no ip address
shutdown
duplex auto
speed auto
!
router ospf 1
log-adjacency-changes
area 35 stub
network 4.4.4.0 0.0.0.255 area 35
network 20.20.1.0 0.0.0.255 area 35
network 20.20.2.0 0.0.0.255 area 35
network 20.20.0.0 0.0.255.255 area 35
!
ip classless
no ip http server
!
!
cdp timer 5
cdp holdtime 10
!
!
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
logging synchronous
transport preferred all
transport output all
stopbits 1
line aux 0
transport preferred all
transport output all
stopbits 1
line vty 0 4
login
transport preferred all
transport input all
transport output all
!
!
end
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R5
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 20.20.1.1 255.255.255.0
ip ospf network point-to-point
!
interface Loopback1
ip address 20.20.2.1 255.255.255.0
ip ospf network point-to-point
!
interface Loopback2
ip address 20.20.3.1 255.255.255.0
ip ospf network point-to-point
!
interface Loopback3
ip address 20.20.4.1 255.255.255.0
ip ospf network point-to-point
!
interface Loopback4
ip address 20.20.5.1 255.255.255.0
ip ospf network point-to-point
!
interface FastEthernet0/0
no ip address
shutdown
duplex half
!
interface FastEthernet1/0
ip address 4.4.4.2 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet1/1
no ip address
shutdown
duplex auto
speed auto
!
router ospf 1
log-adjacency-changes
area 35 stub
network 4.4.4.0 0.0.0.255 area 35
network 20.20.1.0 0.0.0.255 area 35
network 20.20.2.0 0.0.0.255 area 35
network 20.20.0.0 0.0.255.255 area 35
!
ip classless
no ip http server
!
!
cdp timer 5
cdp holdtime 10
!
!
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
logging synchronous
transport preferred all
transport output all
stopbits 1
line aux 0
transport preferred all
transport output all
stopbits 1
line vty 0 4
login
transport preferred all
transport input all
transport output all
!
!
end