MPLS-L3×××中的公网访问
生活随笔
收集整理的這篇文章主要介紹了
MPLS-L3×××中的公网访问
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1.在×××站點內配置一個代理服務器擁有公網IP做NAT,之后網關寫到CE,CE上配置默認路由指向PE,之后PE上做靜態的公網跳出路由,即在靜態路由的下以跳寫public關鍵字。之后做回程路由跳回×××,下一跳寫×××站點地址即可,但是VRP3.X不支持這個辦法因此回程需要用策略路由回了。注意策略路由如果是多角色主機,要同時訪問多個×××則需要策略多個×××如××× A B,才會先后在A,B內進行路由查找。但是對于本×××內找不到的路由還是會回到PUBLIC表即(MAIN表)中查找。但是如果在其他×××找不到了,比如去了B,如果找不到某路由,則路由失敗。 2 做NAT多實例,這個辦法比較好,可是VRP3.X也不能支持。只需要在配置NAT的時候啟用多實例即可。 3 將公網接口綁定到一個×××實例中,然后配置RT策略,把私網路由引入到公網上去。這樣做辦法不是很好。同時將公網路由引入到私網,或是在私網中加入一條全局跳出路由。 舉例多角色主機加訪問公網的一個配置例子靜態路由方式其實是最好的辦法。 [PE2-route-policy]dis cur
#
sysname PE2
#
cpu-usage cycle 1min
#
mpls lsr-id 22.22.22.22
#
radius scheme system
#
mpls
#
ip ***-instance A
route-distinguisher 1:1
***-target 1:1 export-extcommunity
***-target 1:1 import-extcommunity
#
ip ***-instance B
route-distinguisher 1:2
***-target 1:2 export-extcommunity
***-target 1:2 import-extcommunity
#
domain system
#
local-user admin
password cipher .]@USE=B,53Q=^Q`MAF4<1!!
service-type telnet terminal
level 3
service-type ftp
#
acl number 2000
rule 1 permit ***-instance A source 192.168.10.0 0.0.0.255
acl number 2002
rule 0 permit
#
interface Aux0
async mode flow
#
interface Ethernet0/0
ip address dhcp-alloc
#
interface Ethernet0/0.1
ip binding ***-instance A
ip address 1.1.1.5 255.255.255.252
ip policy route-policy DJS
vlan-type dot1q vid 1
#
interface Ethernet0/0.2
ip binding ***-instance B
ip address 1.1.1.5 255.255.255.252???????
vlan-type dot1q vid 2
#
interface Ethernet0/1
ip address dhcp-alloc
#
interface Serial0/0
link-protocol ppp
ip address 1.1.1.2 255.255.255.252
ip policy route-policy internet
#
interface Tunnel1
source 22.22.22.22
destination 11.11.11.11
mpls
#
interface NULL0
#
interface LoopBack1
ip address 22.22.22.22 255.255.255.255
#
bgp 1
undo synchronization
group m-ibgp internal
peer 11.11.11.11 group m-ibgp????????????
peer 11.11.11.11 connect-interface LoopBack1
#
ipv4-family ***-instance A
?? import-route direct
?? import-route ospf 2
?? undo synchronization
#
ipv4-family ***-instance B
?? import-route direct
?? import-route ospf 3
?? import-route static
?? undo synchronization
#
ipv4-family ***v4
?? peer m-ibgp enable
?? peer 11.11.11.11 group m-ibgp
#
ospf 1
import-route static tag 123
area 0.0.0.0
?? network 1.1.1.0 0.0.0.3
?? network 22.22.22.22 0.0.0.0
#
ospf 2 ***-instance A?????????????????????
import-route bgp
area 0.0.0.0
?? network 1.1.1.5 0.0.0.0
#
ospf 3 ***-instance B
import-route bgp
area 0.0.0.0
?? network 1.1.1.5 0.0.0.0
#
route-policy DJS permit node 10
if-match acl 2000
apply access-*** ***-instance B A
route-policy internet permit node 10
if-match acl 2002
apply access-*** ***-instance A
#
FTP server enable
#
ip route-static 192.168.10.0 255.255.255.0 NULL 0 preference 60
ip route-static ***-instance A 0.0.0.0 0.0.0.0 1.1.1.3 public preference 60 description internet
ip route-static ***-instance B 192.168.10.0 255.255.255.0 ***-instance A 1.1.1.6?? preference 60
#
user-interface con 0
user-interface aux 0??????????????????????
user-interface vty 0 4
authentication-mode scheme
#
return 此配置中最關鍵的是?? ip route-static 192.168.10.0 255.255.255.0 NULL 0 preference 60 配置公網的回程路由,到私網的,當然如果有代理服務器久沒必要把私網路由發布到公網上去了。 ip route-static ***-instance A 0.0.0.0 0.0.0.0 1.1.1.3 public preference 60 description internet
在×××A內添加一條全局跳出路由。 route-policy internet permit node 10
if-match acl 2002
apply access-*** ***-instance A
# 配置一個策略路由的方法,將所有回來的數據進行策略路由先在×××A內查找,查不到再返回到publc主要是負責回來的時候,因為VRP3.X不支持回程的×××靜態路由。
#
sysname PE2
#
cpu-usage cycle 1min
#
mpls lsr-id 22.22.22.22
#
radius scheme system
#
mpls
#
ip ***-instance A
route-distinguisher 1:1
***-target 1:1 export-extcommunity
***-target 1:1 import-extcommunity
#
ip ***-instance B
route-distinguisher 1:2
***-target 1:2 export-extcommunity
***-target 1:2 import-extcommunity
#
domain system
#
local-user admin
password cipher .]@USE=B,53Q=^Q`MAF4<1!!
service-type telnet terminal
level 3
service-type ftp
#
acl number 2000
rule 1 permit ***-instance A source 192.168.10.0 0.0.0.255
acl number 2002
rule 0 permit
#
interface Aux0
async mode flow
#
interface Ethernet0/0
ip address dhcp-alloc
#
interface Ethernet0/0.1
ip binding ***-instance A
ip address 1.1.1.5 255.255.255.252
ip policy route-policy DJS
vlan-type dot1q vid 1
#
interface Ethernet0/0.2
ip binding ***-instance B
ip address 1.1.1.5 255.255.255.252???????
vlan-type dot1q vid 2
#
interface Ethernet0/1
ip address dhcp-alloc
#
interface Serial0/0
link-protocol ppp
ip address 1.1.1.2 255.255.255.252
ip policy route-policy internet
#
interface Tunnel1
source 22.22.22.22
destination 11.11.11.11
mpls
#
interface NULL0
#
interface LoopBack1
ip address 22.22.22.22 255.255.255.255
#
bgp 1
undo synchronization
group m-ibgp internal
peer 11.11.11.11 group m-ibgp????????????
peer 11.11.11.11 connect-interface LoopBack1
#
ipv4-family ***-instance A
?? import-route direct
?? import-route ospf 2
?? undo synchronization
#
ipv4-family ***-instance B
?? import-route direct
?? import-route ospf 3
?? import-route static
?? undo synchronization
#
ipv4-family ***v4
?? peer m-ibgp enable
?? peer 11.11.11.11 group m-ibgp
#
ospf 1
import-route static tag 123
area 0.0.0.0
?? network 1.1.1.0 0.0.0.3
?? network 22.22.22.22 0.0.0.0
#
ospf 2 ***-instance A?????????????????????
import-route bgp
area 0.0.0.0
?? network 1.1.1.5 0.0.0.0
#
ospf 3 ***-instance B
import-route bgp
area 0.0.0.0
?? network 1.1.1.5 0.0.0.0
#
route-policy DJS permit node 10
if-match acl 2000
apply access-*** ***-instance B A
route-policy internet permit node 10
if-match acl 2002
apply access-*** ***-instance A
#
FTP server enable
#
ip route-static 192.168.10.0 255.255.255.0 NULL 0 preference 60
ip route-static ***-instance A 0.0.0.0 0.0.0.0 1.1.1.3 public preference 60 description internet
ip route-static ***-instance B 192.168.10.0 255.255.255.0 ***-instance A 1.1.1.6?? preference 60
#
user-interface con 0
user-interface aux 0??????????????????????
user-interface vty 0 4
authentication-mode scheme
#
return 此配置中最關鍵的是?? ip route-static 192.168.10.0 255.255.255.0 NULL 0 preference 60 配置公網的回程路由,到私網的,當然如果有代理服務器久沒必要把私網路由發布到公網上去了。 ip route-static ***-instance A 0.0.0.0 0.0.0.0 1.1.1.3 public preference 60 description internet
在×××A內添加一條全局跳出路由。 route-policy internet permit node 10
if-match acl 2002
apply access-*** ***-instance A
# 配置一個策略路由的方法,將所有回來的數據進行策略路由先在×××A內查找,查不到再返回到publc主要是負責回來的時候,因為VRP3.X不支持回程的×××靜態路由。
轉載于:https://blog.51cto.com/840422/242771
總結
以上是生活随笔為你收集整理的MPLS-L3×××中的公网访问的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 广东2021高考成绩位次查询,广东一分一
- 下一篇: python逐个读取字符_玩转pytho