!R1
conf t
int loopback 1
ip addr 1.1.1.1 255.255.255.255
no sh
int g0/0
ip addr 10.1.12.1 255.255.255.0
no sh
router bgp 1
network 1.1.1.1 mask 255.255.255.255
network 10.1.12.0 mask 255.255.255.0
neighbor 10.1.12.2 remote-as 2
neighbor 10.1.13.3 remote-as 3
exit
!R2
conf t
int loopback 1
ip addr 2.2.2.2 255.255.255.255
no sh
int g0/0
ip addr 10.1.12.2 255.255.255.0
no sh
int g1/0
ip addr 10.1.23.2 255.255.255.0
no sh
exit
router bgp 2
network 2.2.2.2 mask 255.255.255.255
network 10.1.12.0 mask 255.255.255.0
network 10.1.23.0 mask 255.255.255.0
neighbor 10.1.12.1 remote-as 1
neighbor 10.1.23.3 remote-as 3
exit
!R3
conf t
int loopback 1
ip addr 3.3.3.3 255.255.255.255
no sh
int g0/0
ip addr 10.1.23.3 255.255.255.0
no sh
int g1/0
ip addr 10.1.34.3 255.255.255.0
no sh
exit
router bgp 3
network 3.3.3.3 mask 255.255.255.255
network 10.1.23.0 mask 255.255.255.0
neighbor 10.1.12.1 remote-as 1
neighbor 10.1.23.2 remote-as 2
exit
設定為後,R1跟R2形成鄰居,R2跟R3形成鄰居,而R1跟R3卻沒有形成鄰居。
R3#show ip bgp summary
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
10.1.12.1 4 1 0 0 0 0 0 never Idle
IP SLA在教學上多半使用 ICMP-echo,但Cisco CCNP ENARSI需要還要學會:jitter, tracking objects, delay, connectivity)等的應用。
為此,就簡單來帶過一下IP SLA Jitter and Connectivity。
設定
R1先接NAT,透過電腦可以做NAT然後連上網際網路。
R1為設定IP SLA的設備,然後IP SLA目的端為R2或網際網路。
如果要看IP SLA執行的結果,可以在輸入指令:
show ip sla statistics
Jitter
jitter是甚麼?先來點簡單地介紹相關名詞。以下是關於udp-jitter的相關統計值。
IPSLA operation id: 1
Type of operation: udp-jitter
Latest RTT: 17 milliseconds
Latest operation start time: *08:04:34.043 UTC Tue Feb 2 2021
Latest operation return code: OK
RTT Values:
Number Of RTT: 2 RTT Min/Avg/Max: 15/17/20 milliseconds
Latency one-way time:
Number of Latency one-way Samples: 0
Source to Destination Latency one way Min/Avg/Max: 0/0/0 milliseconds
Destination to Source Latency one way Min/Avg/Max: 0/0/0 milliseconds
Jitter Time:
Number of SD Jitter Samples: 1
Number of DS Jitter Samples: 1
Source to Destination Jitter Min/Avg/Max: 7/7/7 milliseconds
Destination to Source Jitter Min/Avg/Max: 2/2/2 milliseconds
Packet Loss Values:
Loss Source to Destination: 0 Loss Destination to Source: 0
Out Of Sequence: 0 Tail Drop: 0
Packet Late Arrival: 0 Packet Skipped: 18
Voice Score Values:
Calculated Planning Impairment Factor (ICPIF): 0
Mean Opinion Score (MOS): 0
Number of successes: 25
Number of failures: 5
Operation time to live: Forever
ip sla 30
http get http://jianning0915.wordpress.com/ name-server 168.95.1.1
timeout 5000
frequency 60 !最小值
exit
ip sla schedule 30 start-time now lift forever
!R1
conf t
int g0/0
ip addr 12.1.2.1 255.255.255.0
no sh
exit
ip route 0.0.0.0 0.0.0.0 12.1.2.2
!R2
conf t
int loopback 1
ip addr 2.2.2.2 255.255.255.255
ip ospf 1 a 0
exit
int g0/0
ip addr 12.1.2.2 255.255.255.0
no sh
ip ospf 1 a 0
int g1/0
ip addr 23.2.3.2 255.255.255.0
no sh
ip ospf 1 a 0
exit
router ospf 1
exit
ip route 0.0.0.0 0.0.0.0 23.2.3.3
!R3
conf t
int loopback 1
ip addr 3.3.3.3 255.255.255.255
ip ospf 1 a 0
int g0/0
ip addr 23.2.3.3 255.255.255.0
no sh
ip ospf 1 a 0
int g1/0
ip addr 34.3.4.3 255.255.255.0
no sh
ip ospf 1 a 0
exit
router ospf 1
exit
ip route 0.0.0.0 0.0.0.0 34.3.4.4
!R4
conf t
int loopback 1
description Fake_WAN
ip addr 99.99.99.99 255.255.255.255
int loopback 2
description Fake_R2
ip addr 2.2.2.2 255.255.255.255
int loopback 3
description Fake_R2
ip addr 12.1.2.2 255.255.255.255
int g0/0
ip addr 34.3.4.4 255.255.255.0
no sh
exit
ip route 0.0.0.0 0.0.0.0 34.3.4.3
首先要在R1打開debug,方便觀察。
debug ip icmp
接著先在R4用正常ping到R1
R4#ping 12.1.2.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.1.2.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/3/4 ms
R3#debug ip icmp
ICMP packet debugging is on
R3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R3(config)#int g1/0
R3(config-if)#ip verify unicast source reachable-via any
R4#ping 12.1.2.1 source loopback 1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.1.2.1, timeout is 2 seconds:
Packet sent with a source address of 99.99.99.99
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/49/64 ms
!R1
conf t
int g0/0
ip addr 10.1.14.1 255.255.255.0
no sh
exit
ip route 0.0.0.0 0.0.0.0 10.1.14.4
!R2
conf t
int g0/0
ip addr 10.1.24.2 255.255.255.0
no sh
exit
ip route 0.0.0.0 0.0.0.0 10.1.24.4
!R3
conf t
int g0/0
ip addr 10.1.34.3 255.255.255.0
no sh
exit
ip route 0.0.0.0 0.0.0.0 10.1.34.4
!R5
conf t
int g0/0
ip addr 10.1.54.5 255.255.255.0
no sh
exit
ip route 0.0.0.0 0.0.0.0 10.1.54.4
!R4
conf t
int g0/0
ip addr 10.1.14.4 255.255.255.0
no sh
exit
int g1/0
ip addr 10.1.24.4 255.255.255.0
no sh
exit
int g2/0
ip addr 10.1.34.4 255.255.255.0
no sh
exit
int g3/0
ip addr 10.1.54.4 255.255.255.0
no sh
exit
int g4/0
ip addr 11.12.13.254 255.255.255.0
no sh
exit
ip route 0.0.0.0 0.0.0.0 11.12.13.1
! snmp
snmp-server community PM-Policing_and_Shaping
要完成Policy-map,得從低階一路組成高階,先下ACL。※這裡指定icmp
! ACL
ip access-list extended R1
permit icmp 10.1.14.0 0.0.0.255 any
ip access-list extended R2
permit icmp 10.1.24.0 0.0.0.255 any
ip access-list extended R3
permit icmp 10.1.34.0 0.0.0.255 any
exit
ACL下完了,才能下Class-map。
! Class-map R1_or_R2
class-map match-any R1_or_R2
match access-group name R1
match access-group name R2
exit
! Class-map R3
class-map match-any R3
match access-group name R3
exit
有了Class-map,才能下Policy-map。
! Policy-map
policy-map Policing_and_Shaping
class R1_or_R2
police 800000 !800000 bit/sec = 100000 byte/sec = 100KB/sec
exceed-action drop
exit
exit
class R3
shape average 800000
queue-limit 10000 bytes
queue-limit 3000 ms
queue-limit 100 packets
exit
exit