当前位置:   article > 正文

R&S,数通HCIP|MPLS虚拟专用网Hub-sopoke式组网配置实验_hub spook

hub spook

一、实验需求

CE1作为Hub,CE2和CE3作为sopoke,要求CE2和CE3之间的通信需要通过CE1。

二、实验拓扑

三、实验配置

步骤一(基础配置,略)

        如图分配各设备的IP地址(CE1的两个子接口IP暂不配置),AS200设备间运行OSPF协议,并配置MPLS。

步骤二: 建立PE1和PE2之间的BGP邻居       

对PE1:

  1. [PE1]bgp 200
  2. [PE1-bgp]undo default ipv4-unicast
  3. [PE1-bgp]peer 4.4.4.4 as-number 200
  4. [PE1-bgp]peer 4.4.4.4 connect-interface lo0
  5. [PE1-bgp]ipv4-family vpnv4
  6. [PE1-bgp-af-vpnv4]peer 4.4.4.4 enable

对PE2:

  1. [PE2]bgp 200
  2. [PE2-bgp]undo default ipv4-unicast
  3. [PE2-bgp]peer 2.2.2.2 as-number 200
  4. [PE2-bgp]peer 2.2.2.2 connect-interface lo0
  5. [PE2-bgp]ipv4-family vpnv4
  6. [PE2-bgp-af-vpnv4]peer 2.2.2.2 enable

效果验证:

PE1与PE2建立了BGP邻居:

步骤三:配置CE1和PE1的子接口进行对接

对CE1:

  1. [CE1]int g0/0/0.10
  2. [CE1-GigabitEthernet0/0/0.10]dot1q termination vid 10
  3. [CE1-GigabitEthernet0/0/0.10]ip address 12.1.1.1 24
  4. [CE1-GigabitEthernet0/0/0.10]arp broadcast enable
  5. [CE1-GigabitEthernet0/0/0.10]int g0/0/0.20
  6. [CE1-GigabitEthernet0/0/0.20]dot1q termination vid 20
  7. [CE1-GigabitEthernet0/0/0.20]ip address 112.1.1.1 24
  8. [CE1-GigabitEthernet0/0/0.20]arp broadcast enable

对PE1:

  1. [PE1]int g0/0/0.10
  2. [PE1-GigabitEthernet0/0/0.10]dot1q termination vid 10
  3. [PE1-GigabitEthernet0/0/0.10]ip address 12.1.1.2 24
  4. [PE1-GigabitEthernet0/0/0.10]arp broadcast enable
  5. [PE1-GigabitEthernet0/0/0.10]int g0/0/0.20
  6. [PE1-GigabitEthernet0/0/0.20]dot1q termination vid 20
  7. [PE1-GigabitEthernet0/0/0.20]ip address 112.1.1.2 24
  8. [PE1-GigabitEthernet0/0/0.20]arp broadcast enable

效果验证:

CE1和PE1可以互通

步骤四:按拓扑图规划RT值进行配置

对PE1,配置虚拟专用网实例in和and,并设置相应的RT、RD值:

  1. [PE1]ip vpn-instance in
  2. [PE1-vpn-instance-in-af-ipv4]route-distinguisher 1:1
  3. [PE1-vpn-instance-in-af-ipv4]vpn-target 200:1 import-extcommunity
  4. [PE1]ip vpn-inst out
  5. [PE1-vpn-instance-out]ipv4-family
  6. [PE1-vpn-instance-out-af-ipv4]route-distinguisher 1:2
  7. [PE1-vpn-instance-out-af-ipv4]vpn-target 100:1 export-extcommunity

对PE2,分别配置实例CE2和CE3,并设置相应的RT、RD值:

  1. [PE2]ip vpn-instance CE2
  2. [PE2-vpn-instance-CE2]ipv4-family
  3. [PE2-vpn-instance-CE2-af-ipv4]route-distinguisher 2:2
  4. [PE2-vpn-instance-CE2-af-ipv4]vpn-target 200:1 export-extcommunity
  5. [PE2-vpn-instance-CE2-af-ipv4]vpn-target 100:1 import-extcommunity
  6. [PE2]ip vpn-instance CE3
  7. [PE2-vpn-instance-CE3]ipv4-family
  8. [PE2-vpn-instance-CE3-af-ipv4]route-distinguisher 2:3
  9. [PE2-vpn-instance-CE3-af-ipv4]vpn-target 200:1 export-extcommunity
  10. [PE2-vpn-instance-CE3-af-ipv4]vpn-target 100:1 import-extcommunity

步骤五:建立CE1和PE1的邻居

对CE1:

  1. [CE1]bgp 100
  2. [CE1-bgp]peer 12.1.1.2 as-number 200
  3. [CE1-bgp]peer 112.1.1.2 as-number 200
  4. [CE1-bgp]network 1.1.1.1 32

对PE1:

  1. [PE1]int g0/0/0.10
  2. [PE1-GigabitEthernet0/0/0.10]ip binding vpn-instance in
  3. [PE1-GigabitEthernet0/0/0.10]ip address 12.1.1.2 24
  4. [PE1-GigabitEthernet0/0/0.10]int g0/0/0.20
  5. [PE1-GigabitEthernet0/0/0.20]ip binding vpn-instance out
  6. [PE1-GigabitEthernet0/0/0.20]ip address 112.1.1.2 24
  7. [PE1]bgp 200
  8. [PE1-bgp]ipv4-family vpn-instance in
  9. [PE1-bgp-in]peer 12.1.1.1 as-number 100
  10. [PE1-bgp]ipv4-family vpn-instance out
  11. [PE1-bgp-in]peer 112.1.1.1 as-number 100

效果验证:PE1的out和in实例均有了1.1.1.1的路由 

步骤六:在PE1上解决因防环机制造成的路由丢弃

对PE1:

  1. [PE1]bgp 200
  2. [PE1-bgp]ipv4-family vpn-instance out
  3. [PE1-bgp-out]peer 112.1.1.1 allow-as-loop

步骤七:配置PE2和CE2以及CE3之间的BGP邻居

对PE2

  1. [PE2]int g0/0/1
  2. [PE2-GigabitEthernet0/0/1]ip binding vpn-instance CE2
  3. [PE2-GigabitEthernet0/0/1]ip address 45.1.1.4 24
  4. [PE2-GigabitEthernet0/0/1]int g0/0/2
  5. [PE2-GigabitEthernet0/0/2]ip binding vpn-instance CE3
  6. [PE2-GigabitEthernet0/0/2]ip address 46.1.1.4 24
  7. [PE2-GigabitEthernet0/0/2]qu
  8. [PE2]bgp 200
  9. [PE2-bgp]ipv4-family vpn-instance CE2
  10. [PE2-bgp-CE2]peer 45.1.1.5 as-number 300
  11. [PE2-bgp-CE2]qu
  12. [PE2-bgp]ipv4-family vpn-instance CE3
  13. [PE2-bgp-CE3]peer 46.1.1.6 as-number 400

对CE2

  1. [CE2]bgp 300
  2. [CE2-bgp]peer 45.1.1.4 as-number 200
  3. [CE2-bgp]network 5.5.5.5 32

对CE3

  1. [CE3]bgp 400
  2. [CE3-bgp]peer 46.1.1.4 as-number 200
  3. [CE3-bgp]network 6.6.6.6 32

四、实验效果

        从CE3上 tracert CE2 发现经过了CE1,实验成功。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/208510
推荐阅读
相关标签
  

闽ICP备14008679号