polycube icon indicating copy to clipboard operation
polycube copied to clipboard

how to use polycube-network to replace iptables nat masq ??

Open pipul opened this issue 3 years ago • 0 comments

iptables:

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

polycube: https://github.com/polycube-network/polycube/blob/master/src/services/pcn-nat/test/test_tcp_masq.sh polycubectl nat add nat1 polycubectl router add r1

polycubectl router r1 ports add to_veth1 ip=$to_veth1_ip/24 peer=veth1 polycubectl router r1 ports add to_veth2 ip=$to_veth2_ip/24 peer=veth2

polycubectl attach nat1 r1:to_veth2 position=first

polycubectl nat1 rule masquerade enable

i don't understand what is the router use for this example seem complicated for me

pipul avatar Aug 21 '22 10:08 pipul