Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm using this guide to set-up a shared internet connection between two PC's.

At step 8 it says I should run the commands:

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
/etc/rc.d/iptables save
/etc/rc.d/iptables start

Doing this seems to have no effect on iptable's rules, if I run iptables -nvL my output is:

Chain INPUT (policy ACCEPT 2223 packets, 2330K bytes)
 pkts bytes target     prot opt in     out     source         destination

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
  pkts bytes target     prot opt in     out     source        destination

Chain OUTPUT (policy ACCEPT 2272 packets, 277K bytes)
  pkts bytes target     prot opt in     out     source        destination

Is that correct or am I doing something wrong?

share|improve this question

1 Answer 1

up vote 8 down vote accepted

The command iptables -nvL is displaying the contents of the filter table. The rule you are adding is in the nat table. Add -t nat to look at the nat table:

iptables -t nat -nvL
share|improve this answer
1  
nice response time :) –  Stefan Sep 11 '10 at 9:19

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.