Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When snatting, from is not used #18

Open
gergnz opened this issue Feb 23, 2014 · 0 comments
Open

When snatting, from is not used #18

gergnz opened this issue Feb 23, 2014 · 0 comments

Comments

@gergnz
Copy link
Contributor

gergnz commented Feb 23, 2014

Example partition:

partition 'x' do
  label 'd', :address => '10.243.4.97'
  label 's', :address => '172.17.7.9'
  label 'n', :address => '10.243.4.3'

  rewrite 'wow' do
    from 's'
    to   'd'
    snat 's' => 'n'
  end
end

Produces:

# x-58816d
iptables --table nat --new-chain x-d58816d
iptables --table nat --new-chain x-s58816d
iptables --table filter --new-chain x-a58816d
iptables --table nat --append x-s58816d --source 172.17.7.9 --jump SNAT --to-source 10.243.4.3
iptables --table filter --append x-a58816d --source 172.17.7.9 --jump ACCEPT
iptables --table nat --insert partition-s --source 172.17.7.9 --jump x-s58816d
iptables --table filter --insert partition-a --source 172.17.7.9 --jump x-a58816d

Where as I would have expect something more like:

# x-58816d
...
iptables --table nat --append x-s58816d --source 172.17.7.9 --destination 10.243.4.97 --jump SNAT --to-source 10.243.4.3
iptables --table filter --append x-a58816d --source 172.17.7.9 --destination 10.243.4.97 --jump ACCEPT
...

The same is true (but flipped) for DNAT. Sometimes you want to DNAT/SNAT on specific sources and destinations to a specific IP.

@gergnz gergnz mentioned this issue Sep 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant