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

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 -P FORWARD ACCEPT
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -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.

Thanks.

share|improve this question
add comment

migrated from stackoverflow.com Aug 1 '10 at 11:02

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

1 Answer

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
add comment

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.