当前位置:网站首页>VPP static mapping to realize DNAT
VPP static mapping to realize DNAT
2022-08-08 09:00:00 【redwingz】
Basic interface configuration:
DBGvpp# set interface state port7 upDBGvpp# set interface state port8 upDBGvpp# set interface ip address port7 50.1.1.1/24DBGvpp# set interface ip address port8 192.168.1.203/24
Network topology:
|------------| |------------| |---------------|| 50.1.1.2 |---------| vpp |------|----| 192.168.1.103 ||------------| |------------| | |---------------|Host-A port7 port8 | Host-B|| |---------------||----| 192.168.1.114 ||---------------|Host-C(FTP-Server)
Enable NAT44 configuration:
DBGvpp# nat44 enable
The following 192.168.1.203 is the real IP address of interface port8, and execute DNAT.The configuration is the same as the above SNAT, which uses VPP static address mapping.
# 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 mappingsNAT44 static mappings:local 50.1.1.2 external 192.168.1.203 vrf 0## show nat44 interfacesNAT44 interfaces:port8 out## show nat44 addressesNAT44 pool addresses:192.168.1.203tenant VRF independent
Execute 192.168.1.103 -> ping -> 192.168.1.203:
- Capture the packet on the host 50.1.1.2, you can see the packet: 192.168.1.103->50.1.1.2, and the replacement of the destination address is performed.
2) Capture the packet on the host 192.168.1.103, and see the packet: 192.168.1.203->192.168.1.103, where the source address is replaced.
The following NAT session looks like:
# show nat44 sessionsNAT44 ED sessions:-------- thread 0 vpp_main: 2 sessions --------i2o 50.1.1.2 proto ICMP port 41039 fib 0o2i 192.168.1.203 proto ICMP port 41039 fib 0external host 192.168.1.103:0i2o 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 41039o2i 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 0index 0last heard 254.15total pkts 5, total bytes 420static translation
边栏推荐
- anormly detection资料汇总
- golang-channel-一个基础channel并行操作的简单函数
- .json()的使用
- Why is HTTS safer?
- Interviewer: Have you ever used a lock at work?Talk about the advantages, disadvantages and usage scenarios of optimistic locking and pessimistic locking
- 22-08-06 西安 EasyExcel实现字典表导入、导出
- 实体List转为excel
- 【office】word
- 中原银行实时风控体系建设实践
- Stanford Fall 21: Practical Machine Learning [Chapter 5]
猜你喜欢
随机推荐
Android Studio关于MainActivity中的“import kotlinx.android.synthetic.main.activity_main.*”出现错误提示
22-08-06 Xi'an EasyExcel implements dictionary table import and export
Nacos是如何实现心跳机制和服务续约以及超时剔除服务机制的?
在数学里,minimum 和 minimal 有啥区别吗?
攻防世界——web2
FRED应用:TMT MOBIE成像光谱仪的概念设计阶段杂散光分析
Literature Learning (part33)--Clustering by fast search and find of density peaks
设计圆类,求圆的周长
DVWA全级别详细通关教程
[Raspberry Pi] vim editor
攻防世界——ics-05
anormly detection资料汇总
实战案例:用 PySpark ML 构建流失预测模型
攻防世界——lottery
你真的了解IP地址吗?
Today share how to submit a bug
Offensive and defensive world - fakebook
手机APP测试流程规范和方法你知道多少?
Raspberry pie 】 【 without WIFI even under the condition of the computer screen
sed命令