Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I installed iptables on a VPS (Virtual Private Server from openVZ) - Linux 2.6.32-24-pve #1 SMP Fri Sep 13 07:29:30 CEST 2013 i686 GNU/Linux.

I also installed: apt-get install iptables-persistent

Iptables status:

iptables -L -v
Chain INPUT (policy ACCEPT 96 packets, 4864 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 297 packets, 11296 bytes) pkts bytes target     prot opt in     out     source               destination

I used these rules to generate the files rules.v4 as well as rules.v6 in /etc/iptables/.

ls -lisah /etc/iptables/
insgesamt 32K
82101653 4,0K drwxr-xr-x   2 root root 4,0K Feb 26 13:37 .
81218355 4,0K drwxr-xr-x 116 root root 4,0K Feb 26 13:37 ..
82100327 8,0K -rw-r--r--   1 root root 7,9K Feb 26 13:36 rules.v4
82101662 8,0K -rw-r--r--   1 root root 7,9K Feb 26 13:36 rules.v6

I rebooted the machine but same output from iptables -L as above.

I tried to iptables-restore < /etc/iptables/rules.v4 as well for rules.v6 but I get this:

iptables-restore: line 154 failed

(at 'COMMIT')

Any ideas where I took the wrong turn?

share|improve this question
    
Is UFW running? It might be overwriting your changes on reboot. –  KevinC Feb 26 at 14:00
    
No, no ufw package installed –  brubaker Feb 26 at 14:31
add comment

2 Answers 2

Please execute below command after applying your rules in iptables.

$ sudo iptables-save

It will save your iptables rules.

Thanks & regards

share|improve this answer
    
Thanks and no. Why? Because there isn't anything usefull from my rulesets (neither rules.ipv4 nor rules.ipv6) in it like I mention above. –  brubaker Feb 26 at 17:03
add comment
up vote 0 down vote accepted

There is a memory allocation limit from a VPS provider therefore it wasn't possible to load iptable rules.

share|improve this answer
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.