網站首頁 編程語言 正文
接口基本配置:
DBGvpp# set interface state port7 up
DBGvpp# set interface state port8 up
DBGvpp# set interface ip address port7 50.1.1.1/24
DBGvpp# set interface ip address port8 192.168.1.203/24
網絡拓撲:
|-----------| |------------| |---------------|
| 50.1.1.2 |---------| vpp |------|----| 192.168.1.103 |
|-----------| |------------| | |---------------|
Host-A port7 port8 | Host-B
|
| |---------------|
|----| 192.168.1.114 |
|---------------|
Host-C(FTP-Server)
啟用NAT44配置:
DBGvpp# nat44 enable
如下192.168.1.203為接口port8的真實IP地址,執行DNAT。配置與以上的SNAT一致,都是使用VPP的靜態地址映射。
# nat44 add address 192.168.1.203
# set interface nat44 in port7 out port8
# nat44 add static mapping local 50.1.1.2 external 192.168.1.203
#
# show nat44 static mappings
NAT44 static mappings:
local 50.1.1.2 external 192.168.1.203 vrf 0
#
# show nat44 interfaces
NAT44 interfaces:
port8 out
#
# show nat44 addresses
NAT44 pool addresses:
192.168.1.203
tenant VRF independent
執行192.168.1.103 -> ping -> 192.168.1.203:
- 在主機50.1.1.2抓包,可見報文: 192.168.1.103->50.1.1.2,執行了目的地址的替換。
2)在主機192.168.1.103抓包,可見報文: 192.168.1.203->192.168.1.103,執行了源地址的替換。
如下NAT會話所示:
# show nat44 sessions
NAT44 ED sessions:
-------- thread 0 vpp_main: 2 sessions --------
i2o 50.1.1.2 proto ICMP port 41039 fib 0
o2i 192.168.1.203 proto ICMP port 41039 fib 0
external host 192.168.1.103:0
i2o flow: match: saddr 50.1.1.2 sport 41039 daddr 192.168.1.103 dport 41039 proto ICMP fib_idx 0 rewrite: saddr 192.168.1.203 icmp-id 41039
o2i flow: match: saddr 192.168.1.103 sport 41039 daddr 192.168.1.203 dport 41039 proto ICMP fib_idx 0 rewrite: daddr 50.1.1.2 icmp-id 41039 txfib 0
index 0
last heard 254.15
total pkts 5, total bytes 420
static translation
原文鏈接:https://blog.csdn.net/sinat_20184565/article/details/126217548
- 上一篇:接口狀態與策略路由表
- 下一篇:apollo配置中心的client端分析
相關推薦
- 2022-07-14 如何修改numpy?array的數據類型_python
- 2023-07-02 Golang?time.Sleep()用法及示例講解_Golang
- 2022-07-01 Keras實現Vision?Transformer?VIT模型示例詳解_python
- 2022-07-04 Android自定義view利用PathEffect實現動態效果_Android
- 2023-04-02 python導出requirements.txt的幾種方法總結_python
- 2022-12-26 React生命周期與父子組件間通信知識點詳細講解_React
- 2022-11-02 Python中turtle庫常用代碼匯總_python
- 2023-01-08 Android的VSYNC機制和UI刷新流程示例詳解_Android
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支