当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
分清成员函数非成员函数和友元函数
sed命令
P7214 [JOISC2020] 治療計画 题解
Redis读写分离(三)
Database_JDBC
2022/8/7
AI引领一场新的科学革命
推荐下载软件
入职半个月的一些思考
My MySQL installation that is how to solve
Recommended download software
【无标题】
写在 26 岁生日
你真的了解IP地址吗?
DVWA full level detailed customs clearance tutorial
HyperLynx(三)传输线类型及相关设置
我的MySQL安装这样了怎么解决也
实体List转为excel
67:第五章:开发admin管理服务:20:开发【解冻/冻结用户,接口】;(用户状态变更后,需要刷新用户状态,即变更用户会话信息:我们一般通过“删除redis中会话信息,强制用户重新登录“来做的;)
Want to use SQL to achieve two days after the data contrast, the new data sheet and a list of tags