IP,环回与静态配置
R1:
R2:
R3:
R4:
R5:
R6:
R7:
ISP部分进行IGP宣告
R2:
ospf 1 router-id 2.2.2.2
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 23.1.1.1 0.0.0. 0
[r2]mpls lsr-id 2.2.2.2
[r2]mpls
[r2-mpls]mpls ldp
[r2-mpls-ldp]q
[r2]interface GigabitEthernet 0/0/1
[r2-GigabitEthernet0/0/1]mpls
[r2-GigabitEthernet0/0/1]mpls ldp
R3\R4与上同理
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 3.3.3.3 0.0.0.0
network 23.1.1.2 0.0.0.0
network 34.1.1.1 0.0.0.0
R4:
ospf 1 router-id 4.4.4.4
area 0.0.00
network 4.4.4.4 0.0.0.0
network 34.1.1.2 0.0.0.0
network 47.1.1.1 0.0. 0.0
MPLS-VPN创建
R2:
[r2]ip vpn-instance a
[r2-vpn-instance-a]ipv4-family
[r2-vpn-instance-a-af-ipv4]route-distinguisher 1:1
[r2-vpn-instance-a-af-ipv4]vpn-target 1:1
[r2]interface GigabitEthernet 0/0/0
[r2-GigabitEthernet0/0/0]ip binding vpn-instance a
[r2-GigabitEthernet0/0/0]ip address 192.168.2.2 24
[r2]ip vpn-instance b
[r2-vpn-instance-a]ipv4-family
[r2-vpn-instance-a-af-ipv4]route-distinguisher 2:2
[r2-vpn-instance-a-af-ipv4]vpn-target 2:2
[r2]interface GigabitEthernet 0/0/0
[r2-GigabitEthernet0/0/0]ip binding vpn-instance b
[r2-GigabitEthernet0/0/0]ip address 192.168.2.2 24
建立bgp邻居关系:
R2:
[r2]bgp 2
[r2-bgp]router-id 2.2.2.2
[r2-bgp]pe 4.4.4.4 as-number 2
[r2-bgp]pe 4.4.4.4 connect-interface LoopBack 0
[r2-bgp]pe 4.4.4.4 next-hop-local
[r2-bgp]ipv4-family vpnv4
[r2-bgp-af-vpnv4]peer 4.4.4.4 enable
R4:
[r4]bgp 2
[r4-bgp]router-id 4.4.4.4
[r4-bgp]pe 2.2.2.2 as-number 2
[r4-bgp]pe 2.2.2.2 connect-interface LoopBack 0
[r4-bgp]pe 2.2.2.2 next-hop-local
[r4-bgp]ipv4-family vpnv4
[r4-bgp-af-vpnv4]peer 2.2.2.2 enable
交互路由:
R2:
ipv4-fami ly vpn-instance a
import-route direct
import- route static
R4:
ipv4-fami ly vpn-instance aa
1 mport-route direct
1 mport-route static
R6:
rip 1
version 2
network 192.168.1.0
network 192.168.2.0
R7:
ospf 1
area 0.0.0.0
network 47.1.1.2 0.0.0.0
network 192.168.3.10.0.0.0
network 192. 168.4.2 0.0.0.0