- 先配公网IP
用ospf将公网打通
4调成沉默接口
测试公网连通性
7的缺省指向4
测试连通性
- 搭建mpls环境
R2
R3
R4
在2上做VRF空间
绑定接口
#
interface GigabitEthernet0/0/0
ip binding vpn-instance b1
ip address 192.168.2.2 255.255.255.0
#
#
interface GigabitEthernet0/0/2
ip binding vpn-instance a1
ip address 192.168.2.2 255.255.255.0
#
在4上做VRF空间
绑定接口
#
interface GigabitEthernet0/0/1
ip binding vpn-instance a2
ip address 192.168.3.1 255.255.255.0
#
interface GigabitEthernet0/0/2
ip binding vpn-instance b2
ip address 192.168.3.1 255.255.255.0
#
在mpls上启动bgp
[R2]bgp 1
[R2-bgp]router-id 2.2.2.2
[R2-bgp]peer 4.4.4.4 as-number 1
[R2-bgp]peer 4.4.4.4 connect-interface LoopBack 0
[R2-bgp]ipv4-family vpnv4
[R2-bgp-af-vpnv4]peer 4.4.4.4 enable
[R4]bgp 1
[R4-bgp]router-id 4.4.4.4
[R4-bgp]peer 2.2.2.2 as-number 1
[R4-bgp]peer 2.2.2.2 connect-interface LoopBack 0
[R4-bgp]ipv4-family vpnv4
[R4-bgp-af-vpnv4]peer 2.2.2.2 enable
给R1配IP
给R6配IP
给R5配IP
给R7配IP
给R2,6间写rip
R6
R2
给R4,7间写ospf
R7
R4
R4学到了7环回
在R2上进行双向重发布
#
rip 1 vpn-instance a1
version 2
network 192.168.2.0
import-route bgp
#
#
ipv4-family vpn-instance a1
import-route rip 1
#
在R4上进行双向重发布
#
ospf 2 vpn-instance a2
import-route bgp
area 0.0.0.0
network 192.168.3.1 0.0.0.0
#
#
ipv4-family vpn-instance a2
import-route ospf 2
#
写静态路由
R1
[R1]ip route-static 192.168.3.0 24 192.168.2.2
[R1]ip route-static 192.168.4.0 24 192.168.2.2
R2
[R2]ip route-static vpn-instance b1 192.168.1.0 24 192.168.2.1
#
ipv4-family vpn-instance b1
import-route direct
import-route static
#
R4
[R4]ip route-static vpn-instance b2 192.168.4.0 24 192.168.3.2
#
ipv4-family vpn-instance b2
import-route direct
import-route static
#
R5
[R5]ip route-static 192.168.1.0 24 192.168.3.1
[R5]ip route-static 192.168.2.0 24 192.168.3.1