華爲ensp模擬器--mpls與bgp的綜合實驗--實現不同站點的安全隔離這是華爲認證必看實驗,不是翻牆ok?

需求

CE1–r5連接公司總部研發區、CE3–r6連接分支機構研發區,CE1和CE3屬於vpna;
CE2–r4連接公司總部非研發區、CE4–r7連接分支機構非研發區,CE2和CE4屬於vpnb。
公司要求通過部署BGP/MPLS IP VPN,實現總部和分支機構的安全互通,同時要求研發區和非研發區間數據隔離。

拓撲設計

在這裏插入圖片描述

配置思路步驟

  1. 配置基本ip地址–pe之間除外,需要配置vpn–ip地址
  2. r1-r3配置ospf全網互通,
  3. r1-r3配置mpls 實現標籤標識
  4. 配置r1與r5的vpn-ip地址,其他同理,四個部分相似
  5. 配置r1與r3之間bgp爲ibgp,建立鄰居,as號爲100
  6. 配置r1與r5之間的bgp,爲ebgp,建立vpn鄰居,四個部分相似。需要把直連鏈路引入bgp中,其他路由做法類似
  7. 最後就是實驗結果:相同站點能夠互通,不同站點不同,能夠有效的實現網絡安全隔離。保障業務的穩定可靠。

配置命令

r1:
ip vpn-instance vpna – 建立vpna站點
ipv4-family
route-distinguisher 100:1
–爲vpna站點的標識,可以隨意,不一樣就行
vpn-target 111:1 export-extcommunity
–打標籤出標籤爲111:1要與相同站點一樣
vpn-target 111:1 import-extcommunity
–打標籤入標籤爲111:1

ip vpn-instance vpnb**-- 建立vpnb站點
ipv4-family
route-distinguisher 100:2**–爲vpnb站點的標識,可以隨意,不一樣就行
vpn-target 222:2 export-extcommunity**–打標籤出標籤爲222:2要與相同站點一樣
vpn-target 222:2 import-extcommunity**–打標籤入標籤爲222:2要與相同站點一樣

mpls lsr-id 1.1.1.9**–爲mpls的id號1.1.1.9
mpls**–mpls的建立,就是使能

mpls ldp**–mpls的類型
interface GigabitEthernet0/0/0
ip binding vpn-instance vpna**–把vpna的ip地址綁定
ip address 10.1.1.2 255.255.255.0

interface GigabitEthernet0/0/1
ip binding vpn-instance vpnb**–vpnb的ip地址綁定
ip address 10.2.1.2 255.255.255.0

interface GigabitEthernet0/0/2
ip address 172.1.1.1 255.255.255.0
mpls
mpls ldp

interface LoopBack1
ip address 1.1.1.9 255.255.255.255

bgp 100
peer 3.3.3.9 as-number 100
peer 3.3.3.9 connect-interface LoopBack1

ipv4-family unicast
undo synchronization
peer 3.3.3.9 enable

ipv4-family vpnv4
policy vpn-target
peer 3.3.3.9 enable

ipv4-family vpn-instance vpna
import-route direct
peer 10.1.1.1 as-number 5000

ipv4-family vpn-instance vpnb
peer 10.2.1.1 as-number 4000

ospf 1
area 0.0.0.0
network 1.1.1.9 0.0.0.0
network 172.1.1.0 0.0.0.255**

r3配置:

ip vpn-instance vpna
ipv4-family
route-distinguisher 200:1
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity

ip vpn-instance vpnb
ipv4-family
route-distinguisher 200:2
vpn-target 222:2 export-extcommunity
vpn-target 222:2 import-extcommunity

mpls lsr-id 3.3.3.9
mpls

mpls ldp

interface GigabitEthernet0/0/0
ip address 172.2.1.2 255.255.255.0
mpls
mpls ldp

interface GigabitEthernet0/0/1
ip binding vpn-instance vpna
ip address 10.3.1.2 255.255.255.0

interface GigabitEthernet0/0/2
ip binding vpn-instance vpnb
ip address 10.4.1.2 255.255.255.0
interface LoopBack1
ip address 3.3.3.9 255.255.255.255

bgp 100
peer 1.1.1.9 as-number 100
peer 1.1.1.9 connect-interface LoopBack1

ipv4-family unicast
undo synchronization
peer 1.1.1.9 enable

ipv4-family vpnv4
policy vpn-target
peer 1.1.1.9 enable

ipv4-family vpn-instance vpna
peer 10.3.1.1 as-number 6000

ipv4-family vpn-instance vpnb
peer 10.4.1.1 as-number 7000

ospf 1
area 0.0.0.0
network 3.3.3.9 0.0.0.0
network 172.2.1.0 0.0.0.255**

r5配置

**interface GigabitEthernet0/0/0
ip address 10.1.1.1 255.255.255.0

bgp 5000
peer 10.1.1.2 as-number 100

ipv4-family unicast
undo synchronization
import-route direct
peer 10.1.1.2 enable
#**

r6配置

**interface GigabitEthernet0/0/0
ip address 10.3.1.1 255.255.255.0
bgp 6000
peer 10.3.1.2 as-number 100

ipv4-family unicast
undo synchronization
import-route direct
peer 10.3.1.2 enable

。。。其他兩個站點類似套路**

實驗驗證

在這裏插入圖片描述
在這裏插入圖片描述
在這裏插入圖片描述
相同站點能夠互相訪問,不同站點不能互相訪問,實現網絡的安全隔離。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章