![](https://s1.51cto.com/attachment/201008/201008031280817363655.jpg)
CE1#sh run
Building configuration...
Current configuration : 1369 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname CE1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
no ip domain lookup
!
ip cef
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 192.168.1.1 255.255.255.0
!
interface FastEthernet0/0
no ip address
shutdown
duplex half
!
interface Serial1/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/1
ip address 10.10.11.1 255.255.255.252
serial restart-delay 0
!
interface Serial1/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/3
no ip address
shutdown
serial restart-delay 0
!
interface ATM3/0
no ip address
shutdown
no atm ilmi-keepalive
!
router bgp 64512
no synchronization
bgp log-neighbor-changes
redistribute connected
neighbor 10.10.11.2 remote-as 100
no auto-summary
!
ip classless
no ip http server
!
!
!
!
!
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
logging synchronous
stopbits 1
line aux 0
stopbits 1
line vty 0 4
!
!
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname CE1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
no ip domain lookup
!
ip cef
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 192.168.1.1 255.255.255.0
!
interface FastEthernet0/0
no ip address
shutdown
duplex half
!
interface Serial1/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/1
ip address 10.10.11.1 255.255.255.252
serial restart-delay 0
!
interface Serial1/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/3
no ip address
shutdown
serial restart-delay 0
!
interface ATM3/0
no ip address
shutdown
no atm ilmi-keepalive
!
router bgp 64512
no synchronization
bgp log-neighbor-changes
redistribute connected
neighbor 10.10.11.2 remote-as 100
no auto-summary
!
ip classless
no ip http server
!
!
!
!
!
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
logging synchronous
stopbits 1
line aux 0
stopbits 1
line vty 0 4
!
!
PE1(config)#do sh run
Building configuration...
Current configuration : 1962 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname PE1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
no ip domain lookup
!
ip vrf vrfa
rd 100:1
route-target export 100:1
route-target import 100:1
!
ip cef
no tag-switching ip propagate-ttl
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface FastEthernet0/0
no ip address
shutdown
duplex half
!
interface Serial1/0
ip vrf forwarding vrfa
ip address 10.10.11.2 255.255.255.252
serial restart-delay 0
clock rate 64000
!
interface Serial1/1
ip address 200.1.11.1 255.255.255.252
tag-switching ip
serial restart-delay 0
clock rate 64000
!
interface Serial1/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/3
no ip address
shutdown
serial restart-delay 0
!
router ospf 100
log-adjacency-changes
network 1.1.1.0 0.0.0.255 area 0
network 200.1.11.0 0.0.0.3 area 0
!
router bgp 100
no synchronization
bgp log-neighbor-changes
neighbor 2.2.2.2 remote-as 100
neighbor 2.2.2.2 update-source Loopback0
neighbor 10.10.11.1 remote-as 64512
no auto-summary
!
address-family ***v4
neighbor 2.2.2.2 activate
neighbor 2.2.2.2 send-community extended
exit-address-family
!
address-family ipv4 vrf vrfa
redistribute connected
neighbor 10.10.11.1 remote-as 64512
neighbor 10.10.11.1 activate
no auto-summary
no synchronization
exit-address-family
!
ip classless
no ip http server
!
!
!
!
!
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
logging synchronous
stopbits 1
line aux 0
stopbits 1
line vty 0 4
!
!
end
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname PE1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
no ip domain lookup
!
ip vrf vrfa
rd 100:1
route-target export 100:1
route-target import 100:1
!
ip cef
no tag-switching ip propagate-ttl
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface FastEthernet0/0
no ip address
shutdown
duplex half
!
interface Serial1/0
ip vrf forwarding vrfa
ip address 10.10.11.2 255.255.255.252
serial restart-delay 0
clock rate 64000
!
interface Serial1/1
ip address 200.1.11.1 255.255.255.252
tag-switching ip
serial restart-delay 0
clock rate 64000
!
interface Serial1/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/3
no ip address
shutdown
serial restart-delay 0
!
router ospf 100
log-adjacency-changes
network 1.1.1.0 0.0.0.255 area 0
network 200.1.11.0 0.0.0.3 area 0
!
router bgp 100
no synchronization
bgp log-neighbor-changes
neighbor 2.2.2.2 remote-as 100
neighbor 2.2.2.2 update-source Loopback0
neighbor 10.10.11.1 remote-as 64512
no auto-summary
!
address-family ***v4
neighbor 2.2.2.2 activate
neighbor 2.2.2.2 send-community extended
exit-address-family
!
address-family ipv4 vrf vrfa
redistribute connected
neighbor 10.10.11.1 remote-as 64512
neighbor 10.10.11.1 activate
no auto-summary
no synchronization
exit-address-family
!
ip classless
no ip http server
!
!
!
!
!
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
logging synchronous
stopbits 1
line aux 0
stopbits 1
line vty 0 4
!
!
end
P(config-if)#do sh run
Building configuration...
Building configuration...
Current configuration : 1260 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname P
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
no ip domain lookup
!
ip cef
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
no ip address
shutdown
duplex half
!
interface Serial1/0
ip address 200.1.11.2 255.255.255.252
tag-switching ip
serial restart-delay 0
!
interface Serial1/1
ip address 200.1.22.2 255.255.255.252
tag-switching ip
serial restart-delay 0
!
interface Serial1/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/3
no ip address
shutdown
serial restart-delay 0
!
router ospf 100
log-adjacency-changes
network 200.1.11.0 0.0.0.3 area 0
network 200.1.22.0 0.0.0.3 area 0
!
ip classless
no ip http server
!
!
!
!
!
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
logging synchronous
stopbits 1
line aux 0
stopbits 1
line vty 0 4
!
!
end
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname P
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
no ip domain lookup
!
ip cef
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
no ip address
shutdown
duplex half
!
interface Serial1/0
ip address 200.1.11.2 255.255.255.252
tag-switching ip
serial restart-delay 0
!
interface Serial1/1
ip address 200.1.22.2 255.255.255.252
tag-switching ip
serial restart-delay 0
!
interface Serial1/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/3
no ip address
shutdown
serial restart-delay 0
!
router ospf 100
log-adjacency-changes
network 200.1.11.0 0.0.0.3 area 0
network 200.1.22.0 0.0.0.3 area 0
!
ip classless
no ip http server
!
!
!
!
!
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
logging synchronous
stopbits 1
line aux 0
stopbits 1
line vty 0 4
!
!
end
PE2(config)#do sh run
Building configuration...
Current configuration : 1983 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname PE2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
no ip domain lookup
!
ip vrf vrfa
rd 100:1
route-target export 100:1
route-target import 100:1
!
ip cef
no tag-switching ip propagate-ttl
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 2.2.2.2 255.255.255.255
!
interface FastEthernet0/0
no ip address
shutdown
duplex half
!
interface Serial1/0
ip address 200.1.22.1 255.255.255.252
tag-switching ip
serial restart-delay 0
clock rate 64000
!
interface Serial1/1
ip vrf forwarding vrfa
ip address 10.10.22.2 255.255.255.252
serial restart-delay 0
clock rate 64000
!
interface Serial1/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/3
no ip address
shutdown
serial restart-delay 0
!
router ospf 100
log-adjacency-changes
network 2.2.2.0 0.0.0.255 area 0
network 200.1.22.0 0.0.0.3 area 0
!
router bgp 100
no synchronization
bgp log-neighbor-changes
neighbor 1.1.1.1 remote-as 100
neighbor 1.1.1.1 update-source Loopback0
neighbor 10.10.22.1 remote-as 64513
no auto-summary
!
address-family ***v4
neighbor 1.1.1.1 activate
neighbor 1.1.1.1 send-community extended
exit-address-family
!
address-family ipv4 vrf vrfa
redistribute connected
redistribute static
neighbor 10.10.22.1 remote-as 64513
neighbor 10.10.22.1 activate
no auto-summary
no synchronization
exit-address-family
!
ip classless
no ip http server
!
!
!
!
!
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
logging synchronous
stopbits 1
line aux 0
stopbits 1
line vty 0 4
!
!
end
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname PE2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
no ip domain lookup
!
ip vrf vrfa
rd 100:1
route-target export 100:1
route-target import 100:1
!
ip cef
no tag-switching ip propagate-ttl
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 2.2.2.2 255.255.255.255
!
interface FastEthernet0/0
no ip address
shutdown
duplex half
!
interface Serial1/0
ip address 200.1.22.1 255.255.255.252
tag-switching ip
serial restart-delay 0
clock rate 64000
!
interface Serial1/1
ip vrf forwarding vrfa
ip address 10.10.22.2 255.255.255.252
serial restart-delay 0
clock rate 64000
!
interface Serial1/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/3
no ip address
shutdown
serial restart-delay 0
!
router ospf 100
log-adjacency-changes
network 2.2.2.0 0.0.0.255 area 0
network 200.1.22.0 0.0.0.3 area 0
!
router bgp 100
no synchronization
bgp log-neighbor-changes
neighbor 1.1.1.1 remote-as 100
neighbor 1.1.1.1 update-source Loopback0
neighbor 10.10.22.1 remote-as 64513
no auto-summary
!
address-family ***v4
neighbor 1.1.1.1 activate
neighbor 1.1.1.1 send-community extended
exit-address-family
!
address-family ipv4 vrf vrfa
redistribute connected
redistribute static
neighbor 10.10.22.1 remote-as 64513
neighbor 10.10.22.1 activate
no auto-summary
no synchronization
exit-address-family
!
ip classless
no ip http server
!
!
!
!
!
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
logging synchronous
stopbits 1
line aux 0
stopbits 1
line vty 0 4
!
!
end
CE2(config)#do sh run
Building configuration...
Building configuration...
Current configuration : 1377 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname CE2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
no ip domain lookup
!
ip cef
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 192.168.2.1 255.255.255.0
!
interface FastEthernet0/0
no ip address
shutdown
duplex half
!
interface Serial1/0
ip address 10.10.22.1 255.255.255.252
serial restart-delay 0
!
interface Serial1/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/3
no ip address
shutdown
serial restart-delay 0
!
router bgp 64513
bgp log-neighbor-changes
neighbor 10.10.22.2 remote-as 100
!
address-family ipv4
redistribute connected
neighbor 10.10.22.2 activate
no auto-summary
no synchronization
exit-address-family
!
ip classless
no ip http server
!
!
!
!
!
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
logging synchronous
stopbits 1
line aux 0
stopbits 1
line vty 0 4
!
!
end
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname CE2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
no ip domain lookup
!
ip cef
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 192.168.2.1 255.255.255.0
!
interface FastEthernet0/0
no ip address
shutdown
duplex half
!
interface Serial1/0
ip address 10.10.22.1 255.255.255.252
serial restart-delay 0
!
interface Serial1/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/3
no ip address
shutdown
serial restart-delay 0
!
router bgp 64513
bgp log-neighbor-changes
neighbor 10.10.22.2 remote-as 100
!
address-family ipv4
redistribute connected
neighbor 10.10.22.2 activate
no auto-summary
no synchronization
exit-address-family
!
ip classless
no ip http server
!
!
!
!
!
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
logging synchronous
stopbits 1
line aux 0
stopbits 1
line vty 0 4
!
!
end
连通性测试:
CE1#ping 192.168.2.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/68/248 ms
CE1#
Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/68/248 ms
CE1#
CE2#ping 192.168.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 92/418/1572 ms
CE2#
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 92/418/1572 ms
CE2#
CE1#traceroute
Protocol [ip]:
Target IP address: 192.168.2.1
Source address: 192.168.1.1
Numeric display [n]: 10
Timeout in seconds [3]:
Probe count [3]:
Minimum Time to Live [1]:
Maximum Time to Live [30]:
Port Number [33434]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Type escape sequence to abort.
Tracing the route to 192.168.2.1
Protocol [ip]:
Target IP address: 192.168.2.1
Source address: 192.168.1.1
Numeric display [n]: 10
Timeout in seconds [3]:
Probe count [3]:
Minimum Time to Live [1]:
Maximum Time to Live [30]:
Port Number [33434]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Type escape sequence to abort.
Tracing the route to 192.168.2.1
1 10.10.11.2 168 msec 72 msec 16 msec
2 200.1.11.2 436 msec 84 msec 20 msec
3 10.10.22.2 [AS 100] 296 msec 68 msec 20 msec
4 10.10.22.1 [AS 100] 420 msec 84 msec *
2 200.1.11.2 436 msec 84 msec 20 msec
3 10.10.22.2 [AS 100] 296 msec 68 msec 20 msec
4 10.10.22.1 [AS 100] 420 msec 84 msec *
在PE1路上器上全局模式,使用tag-switching ip propagate-ttl
就会带会带进公网IP信息。(这个是默认的)
CE2#traceroute
Protocol [ip]:
Target IP address: 192.168.1.1
Source address: 192.168.2.1
Numeric display [n]: 10
Timeout in seconds [3]:
Probe count [3]:
Minimum Time to Live [1]:
Maximum Time to Live [30]:
Port Number [33434]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Type escape sequence to abort.
Tracing the route to 192.168.1.1
Protocol [ip]:
Target IP address: 192.168.1.1
Source address: 192.168.2.1
Numeric display [n]: 10
Timeout in seconds [3]:
Probe count [3]:
Minimum Time to Live [1]:
Maximum Time to Live [30]:
Port Number [33434]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Type escape sequence to abort.
Tracing the route to 192.168.1.1
1 10.10.22.2 184 msec 64 msec 8 msec
2 10.10.11.2 [AS 100] 188 msec 64 msec 16 msec
3 10.10.11.1 [AS 100] 296 msec * 44 msec
在PE2路上器上全局模式,使用no tag-switching ip propagate-ttl
2 10.10.11.2 [AS 100] 188 msec 64 msec 16 msec
3 10.10.11.1 [AS 100] 296 msec * 44 msec
在PE2路上器上全局模式,使用no tag-switching ip propagate-ttl
就会隐藏公网路由
转载于:https://blog.51cto.com/xingno/366378