OpenVZ Forum


Home » General » Support » IP-Tables Problem on vz-machine bei stateful inspection (Error-Msg: iptables: Invalid argument)
IP-Tables Problem on vz-machine bei stateful inspection [message #39060] Wed, 10 March 2010 22:44 Go to next message
Erdbeergulasch is currently offline  Erdbeergulasch
Messages: 6
Registered: March 2010
Junior Member
Hello,

I have a sh-script that contains this code:
echo "Initialize Firewall"
iptables -F
iptables -X
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
iptables -Z

#Stateful Inspection
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT


but when i run this script, i get this error:
# /opt/firewall_script.sh
Initialize Firewall
iptables: Invalid argument


I dont't think, that i have forgotten any kernel-module to load (on my host machine):
# lsmod | grep nf
nf_nat_ftp              7296  0 
nf_nat                 22548  2 ipt_MASQUERADE,nf_nat_ftp
nf_conntrack_ftp       12728  1 nf_nat_ftp
nf_conntrack_ipv4      24352  2 nf_nat
nf_conntrack           82688  5 xt_state,nf_nat_ftp,nf_nat,nf_conntrack_ftp,nf_conntrack_ipv4

# lsmod | grep ipt
ipt_MASQUERADE          6528  0 
ipt_LOG                10372  2 
nf_nat                 22548  2 ipt_MASQUERADE,nf_nat_ftp
ipt_ttl                 6144  0 
iptable_mangle          8704  0 
iptable_filter          8320  1 
ipt_REJECT              7552  0 
ip_tables              21776  2 iptable_mangle,iptable_filter
x_tables               25736  13 xt_state,ipt_MASQUERADE,ipt_LOG,xt_tcpudp,xt_length,ipt_ttl,xt_tcpmss,xt_TCPMSS,xt_multiport,xt_limit,xt_dscp,ipt_REJECT,ip_tables


My Host is this Machine:
# uname -a
Linux Debian-50-lenny-64-minimal 2.6.26-2-openvz-amd64 #1 SMP Thu Feb 11 01:40:09 UTC 2010 x86_64 GNU/Linux


My Virtual-Image is this Machine:
uname -a
Linux xx.xx.net 2.6.26-2-openvz-amd64 #1 SMP Thu Feb 11 01:40:09 UTC 2010 x86_64 GNU/Linux


I don't know why there is any problem.
But maybe it is useful for you, that if i forget to load the module ipt_state, than i get this error.
iptables: No chain/target/match by that name


plz Help me.
thx

[Updated on: Sat, 13 March 2010 10:21]

Report message to a moderator

Re: IP-Tables Problem on vz-machine bei stateful inspection [message #39130 is a reply to message #39060] Wed, 17 March 2010 18:47 Go to previous messageGo to next message
curx
Messages: 739
Registered: February 2006
Location: Nürnberg, Germany
Senior Member

kmod xt_state is loaded on your hdw-node, so plz paste:

$ vzctl exec <CTID> 'grep state /proc/net/ip_tables_matches'

Bye,
Thorsten
Re: IP-Tables Problem on vz-machine bei stateful inspection [message #39172 is a reply to message #39060] Mon, 22 March 2010 19:49 Go to previous messageGo to next message
Paparaciz
Messages: 302
Registered: August 2009
Senior Member
Erdbeergulasch wrote on Thu, 11 March 2010 00:44


But maybe it is useful for you, that if i forget to load the module ipt_state, than i get this error.
iptables: No chain/target/match by that name


plz Help me.
thx


did you added ipt_state to vz.conf IPTABLES section?
Re: IP-Tables Problem on vz-machine bei stateful inspection [message #39176 is a reply to message #39172] Mon, 22 March 2010 23:25 Go to previous message
Erdbeergulasch is currently offline  Erdbeergulasch
Messages: 6
Registered: March 2010
Junior Member
Yes, I did.
Previous Topic: Hostserver with virtual Gateway and virtual Servers
Next Topic: Making a manual IP configuration 'stick'
Goto Forum:
  


Current Time: Wed Aug 07 09:29:14 GMT 2024

Total time taken to generate the page: 0.02857 seconds