partition 'x' do
label 'a', :address => '10.243.4.97'
label 'b', :address => '10.243.4.3'
rewrite 'do a dnat' do
protocols 'tcp', 'udp'
ports 6050, 6051, 41524
dnat 'a' => 'b'
end
raw <<-RAW
iptables -t nat -I INPUT -j ACCEPT
RAW
end
Produces:
# x-cd79a8
iptables --table nat --new-chain x-dcd79a8
iptables --table nat --new-chain x-scd79a8
iptables --table filter --new-chain x-acd79a8
iptables --table nat --append x-d --protocol tcp --destination 10.243.4.97 --dport 6050 --jump DNAT --to-destination 10.243.4.3
iptables --table filter --append x-a --protocol tcp --destination 10.243.4.3 --dport 6050 --jump ACCEPT
iptables --table nat --append x-d --protocol udp --destination 10.243.4.97 --dport 6050 --jump DNAT --to-destination 10.243.4.3
iptables --table filter --append x-a --protocol udp --destination 10.243.4.3 --dport 6050 --jump ACCEPT