上一篇講到SNAT,這篇試驗DNATnginx
首先在host機器上安裝nginx後端
apt-get install nginx
確認服務啓動bash
DNAT配置app
# 設置DNat,將ethvpp-pub口的tcp 80端口號映射到本地10.10.5.2的80端口號 vpp# nat44 add static mapping tcp local 10.10.5.2 80 external ethvpp-pub 80 # 查看 vpp# show nat44 static mapping NAT44 static mappings: tcp local 10.10.5.2:80 external 210.73.218.162:80 vrf 0 tcp local 10.10.5.2:80 external ethvpp-pub:80 vrf -1
我本地終端測試tcp
可見訪問210.73.218.162的80端口已經正確轉換到了後端的10.10.5.2上80口的nginx服務了。測試