Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Greet Everybody I have some problems about iptables rules under Ubuntu .

I create a simple firewall with the function of NAT,then restart the server. the command to create:

iptables -F
iptables -P INPUT ACCEPT
iptables -t nat -A POSTROUTING -s -o eth0 -j MASQUERADE

type commands below in the terminal:

iptables -L -v

But display no rules. And it seemd that the NAT function and the rules made last time are still available to use.

Is it necessary to create some script to save the rules . Will the rules got lost when I restart the server.


share|improve this question

migrated from Aug 1 '10 at 11:02

This question came from our site for professional and enthusiast programmers.

iptables by default lists filter rules. Use

iptables -t nat -L

to see NAT rules.

share|improve this answer
Solve my problem.Thanks. – kit.yang Aug 1 '10 at 10:03

Your Answer


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.