Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I want to bind IPs to non-root users so that all outgoing applications will use that IP for the user. I have this:

iptables -t nat -A POSTROUTING -m owner --uid-owner xxx -j SNAT --to-source xxx.xxx.xxx.xxx

But when I when I do check iptables:

# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Nothing shows up.

share|improve this question

1 Answer 1

You need to do

iptables -t nat -L

to see the rules you've added, since your commands are in the nat table, not the default filter table:

$ man iptables
..snip..
  --table   -t table    table to manipulate (default: `filter')

which is why iptables -L shows up blank, because you have no rules in your filter table.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.