在華為裝置上實施GRE隧道和IPSECVPN
IPSEC VPN是幹私活利器哦,歡迎大家學習和掌握
私有的BGP的AS號碼:64512~65535,網際網路的基礎就是BGP
VPN的簡單分類:
一大類IPSEC VPN,這是一個框架,包含很多解決方案
LAN to LAN VPN(站點到站點的VPN)僅僅是IPSEC VPN中的一小類而已,它基於internet實現
另外一類是MPLS VPN(多協議標籤交換),又分成L3VPN(peer2peer,即裝置之間建立路由協議鄰居);IPSEC的框架:1)AH(認證頭部) 2)ESP(安全頭部負載封裝,協議號50) 3)IKE(網際網路祕鑰交換協議)–面試常見題目
會形成兩種SA(安全關聯):ISAKMP SA和IPSEC SA
傳輸模式和隧道模式
實施拓撲:
1.實施GRE隧道(協議號47),它的特點是支援路由協議。如果實現加密的叫做GRE over IPSEC
R1:
interface Tunnel0/0/0
tunnel-protocol gre
source 202.100.1.1
destination 202.100.1.2
ip address 10.1.12.1 24
R2:
interface Tunnel0/0/0
tunnel-protocol gre
source 202.100.1.2
destination 202.100.1.1
ip address 10.1.12.2 255.255.255.0
[Huawei-Tunnel0/0/0]ping 10.1.12.2
PING 10.1.12.2: 56 data bytes, press CTRL_C to break
Reply from 10.1.12.2: bytes=56 Sequence=1 ttl=255 time=70 ms
Reply from 10.1.12.2: bytes=56 Sequence=2 ttl=255 time=30 ms
在GRE隧道上實施路由協議:
[R2-GigabitEthernet0/0/1]dis cu conf rip
[V200R003C00]
#
rip 1
version 2
network 10.0.0.0 //實施在GRE隧道上的動態路由協議
!
[R1-rip-1]dis th
[V200R003C00]
#
rip 1
version 2
network 10.0.0.0
通過GRE隧道得到的路由
[R1-rip-1]dis ip rou pro rip
Route Flags: R – relay, D – download to fib
Public routing table : RIP
Destinations : 1 Routes : 1
RIP routing table status : <Active>
Destinations : 1 Routes : 1
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.1.2.0/24 RIP 100 1 D 10.1.12.2 Tunnel0/0/0
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
終端的通訊:
PC>ping 10.1.1.1
Ping 10.1.1.1: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 10.1.1.1: bytes=32 seq=2 ttl=126 time=15 ms
From 10.1.1.1: bytes=32 seq=3 ttl=126 time=15 ms
From 10.1.1.1: bytes=32 seq=4 ttl=126 time=15 ms
From 10.1.1.1: bytes=32 seq=5 ttl=126 time=15 ms
— 10.1.1.1 ping statistics —
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 0/15/15 ms
2.L2L的IPSEC VPN
實施步驟:1)實施路由的可達性
HEDEX
加解密裝置至少需要3條路由:A.到達對端加解密點的路由;B.到達本端通訊點的路由;C.到達對端通訊點的路由(這點容易忽略,但是轉發裝置如果沒有到達目的地的路由就丟棄資料包)
R1的路由實施:
[R1]ip route-static 10.1.2.0 24 g0/0/0 202.100.1.2
另外兩個要求預設使用直連路由完成
[R2]ip route-static 0.0.0.0 0.0.0.0 g0/0/0 202.100.1.1
2)實施第一階段的Proposal策略
R1&R2:
ipsec proposal QYT
esp authentication-algorithm sha1
[R2]display ipsec proposal
Number of proposals: 1
IPSec proposal name: QYT
Encapsulation mode: Tunnel
Transform : esp-new
ESP protocol : Authentication SHA1-HMAC-96
Encryption DES
[R2]
3)實施SPD(ACL來匹配哪些資料通過IPSEC 處理),感興趣
R1:
acl name VPN 3999
rule 10 permit ip source 10.1.1.0 0.0.0.255 destination 10.1.2.0 0.0.0.255
R2:
acl name VPN 3999
rule 10 permit ip source 10.1.2.0 0.0.0.255 destination 10.1.1.0 0.0.0.255
4)整合IPSEC 策略
R1:
ipsec policy NONGDA 10 manual
security acl 3999
proposal QYT
tunnel local 202.100.1.1
tunnel remote 202.100.1.2
sa spi inbound esp 6543
sa string-key inbound esp simple nongda
sa spi outbound esp 3456
sa string-key outbound esp simple nongda
R2:
ipsec policy NONGDA 10 manual
security acl 3999
proposal QYT
tunnel local 202.100.1.2
tunnel remote 202.100.1.1
sa spi inbound esp 3456
sa string-key inbound esp simple nongda
sa spi outbound esp 6543
sa string-key outbound esp simple **
應用策略
兩個閘道器裝置應用:
interface GigabitEthernet0/0/0
ip address 202.100.1.2 255.255.255.252
ipsec policy NONGDA
[R2]dis ipsec sa //驗證安全關聯
===============================
Interface: GigabitEthernet0/0/0
Path MTU: 1500
IPSec policy name: “NONGDA”
Sequence number : 10
Acl Group : 3999
Acl rule : 0
Mode : Manual
Encapsulation mode: Tunnel
Tunnel local : 202.100.1.2
Tunnel remote : 202.100.1.1
Qos pre-classify : Disable
[Outbound ESP SAs]
SPI: 6543 (0x198f)
Proposal: ESP-ENCRYPT-DES-64 ESP-AUTH-SHA1
No duration limit for this SA
[Inbound ESP SAs]
SPI: 3456 (0xd80)
Proposal: ESP-ENCRYPT-DES-64 ESP-AUTH-SHA1
No duration limit for this SA
[R2]dis ipsec statistics esp //驗證通過SEC加解密的報文
Inpacket count : 9
Inpacket auth count : 0
Inpacket decap count : 0
Outpacket count : 7
NAT bypass(用acl拒絕掉VPN流量,再配置其他流量去訪問網際網路),即在NAT環境下實施IPSEC VPN
本文轉自EnderJoe 51CTO部落格,原文連結:http://blog.51cto.com/enderjoe/2057897
相關文章
- 華為裝置ospf實現全網互通
- 在華為平板上安裝microG的方法
- 華為裝置堆疊原理
- 在Ubuntu上建立並測試GRE tunnelUbuntu
- 華為裝置OSPF單區域配置
- GRE/PPTP/L2TP/L2隧道協議-VeCloudpptp協議Cloud
- 華為通訊裝置密碼設定密碼
- AssetBundle在移動裝置上丟失
- 零程式碼零硬體玩轉華為雲IoT,基於裝置聯動實時監控裝置
- 在 Android 裝置上搭建 Web 伺服器AndroidWeb伺服器
- Omdia:2023年華為在全球通訊裝置市場份額達到31.3%
- Microsoft WPBT漏洞可讓黑客在Windows裝置上安裝rootkitROS黑客Windows
- 一個在 iOS 裝置螢幕上實時列印 Log 的小工具iOS
- 華為:2024年上半年華為可穿戴裝置出貨量排名全球第一
- 2022年12月線上GRE考試解析為你答案助力
- 華三裝置升級教程
- 在不同裝置上如何使用代理IP:桌面端、移動端和瀏覽器瀏覽器
- python開發華為雲應用側進行裝置接入Python
- WOMBO入駐AppGallery,為華為裝置帶來AI對口型的樂趣APPAI
- 偽裝為 WAV 的惡意軟體在受害裝置上挖礦,但其 bug 導致藍屏
- GRE
- Windows ICMP DNS隧道是一種利用ICMP和DNS協議進行網路隧道傳輸的技術。它透過將資料包封裝在ICMP或DNS報文中,繞過防火牆和其他安全裝置,實現在受限網路之間傳輸資料的方法。WindowsDNS協議封裝防火牆
- CoBank:移除和更換美國市場華為電信裝置成本將超10億美元
- 在華為雲 OSC 上快速部署 EMQX MQTT 叢集MQQT
- 什麼是隧道代理 為什麼選隧道代理
- Service Mesh 在華為公有云的實踐
- MobileBERT:一個在資源有限裝置上使用的BERT模型模型
- 手把手教你在 SuperEdge 上用 EdgeX Foundry 接入 IoT 裝置
- 在CentOS 7.5上安裝和配置ProFTPDCentOSFTP
- MariaDB在Linux和Windows上的安裝LinuxWindows
- 在Red Hat和Centos上安裝MongoDBCentOSMongoDB
- GRE配置
- 工業裝置資料快速接入華為雲物聯網平臺
- 在Windows筆記本上除錯執行在iOS裝置上的前端應用Windows筆記除錯iOS前端
- 2023年2月線上GRE考試解析為你答案助力【今日/推薦】
- 實踐 | 為 Trackr app 適配大螢幕裝置APP
- 在 Mac 上通過 VirtualBox 將 Windows 10 安裝到可移動裝置中MacWindows
- 智慧通訊閘道器管理裝置(藉助工業智慧閘道器實現工業裝置線上監控和維護)
- 在AWS無伺服器架構上實施應用程式介面伺服器架構