0

I got an issue with iptables on my virtual machines.

I installed proxmox 3.1-21 on my rootserver. I have around 6 IPs linked to my rootserver so i created new 'CT's.

The problem is i need to redirect ports to a destination port, the command for this is this:

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 10001 -j REDIRECT --to-port 9001

The problem is, my ct does return me now this error:

iptables v1.4.21: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded

How can I fix this issue? I already looked around on several websites. I also found the directly same question somewhere on a proxmox forum where no one replied.

1 Answer 1

1

You are missing NAT (iptable_nat) and REDIRECT (ipt_redirect) iptables modules in your VZ configuration. You have to modify IPTABLES variable in /etc/vz/vz.conf for example like this:

IPTABLES="ipt_REJECT ipt_tos ipt_TOS ipt_LOG ip_conntrack ip_conntrack_ftp ip_conntrack_irc ipt_owner ipt_length ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length ipt_state iptable_nat ip_nat_ftp ipt_recent ipt_REDIRECT"

Then I guess it should be enough to restart just containers you need NAT in, but try to restart VZ as well.

2
  • Found this idea also over the web. The only issue, this is my output, when i search vz-folder in etc: $ vim /etc/v vim/ vtrgb That means i dont have a vz folder... Oh wait, i need to do that on my rootserver. Testing now. Oct 10, 2014 at 9:16
  • 1
    That was it, solution was to add in on the rootserver vz-folder. Then using service vz restart and it works now. Wonderful. Thanks. Oct 10, 2014 at 9:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .