fix nat
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
e22f3d4e67
commit
a163b7d1d8
1 changed files with 2 additions and 2 deletions
|
|
@ -12,7 +12,7 @@ function add_public_ip {
|
|||
ip -n "${vpc_name}" r add default via "${host_ip}"
|
||||
|
||||
ip netns exec "${vpc_name}" iptables -t nat -A PREROUTING -d "${public_ip}/32" -j DNAT --to-destination "${private_ip}"
|
||||
ip netns exec "${vpc_name}" iptables -t nat -A POSTROUTING -s "${private_ip}/32" -o br-public --to-source "${public_ip}" -j SNAT
|
||||
ip netns exec "${vpc_name}" iptables -t nat -A POSTROUTING -s "${private_ip}/32" -o br-public -j SNAT --to-source "${public_ip}"
|
||||
}
|
||||
|
||||
function delete_public_ip {
|
||||
|
|
@ -24,5 +24,5 @@ function delete_public_ip {
|
|||
ip r del "${public_ip}" dev br-public
|
||||
|
||||
ip netns exec "${vpc_name}" iptables -t nat -D PREROUTING -d "${public_ip}/32" -j DNAT --to-destination "${private_ip}"
|
||||
ip netns exec "${vpc_name}" iptables -t nat -D POSTROUTING -s "${private_ip}/32" -o br-public --to-source "${public_ip}" -j SNAT
|
||||
ip netns exec "${vpc_name}" iptables -t nat -D POSTROUTING -s "${private_ip}/32" -o br-public -j SNAT --to-source "${public_ip}"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue