Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

I installed OpenVZ on my Debian 6 server which has only 1 IP.
So I tried to follow this guide on the OpenVZ wiki, but alas only with partial luck.
I succesfully forwarded port 8090 of the Host server to the port 80 of a container.
But I still can't connect to the internet from inside the container.
My NAT iptable looks like this:

Chain PREROUTING (policy ACCEPT 43M packets, 26G bytes)
 pkts bytes target     prot opt in     out     source               destination
   21  1008 DNAT       tcp  --  *      *            IP_ADDRESS          tcp dpt:8090 to:

Chain POSTROUTING (policy ACCEPT 34571 packets, 6317K bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 SNAT       all  --  *      eth0             to:IP_ADDRESS

IP_ADDRESS being the hosts/servers ip address, being the containers ip address and eth0 being the physical network interface.
IP forwarding is enabled (cat /proc/sys/net/ipv4/ip_forward == 1).

Why can I still not connect to the internet from inside a container?

share|improve this question
up vote 1 down vote accepted

I finally found what the problem was.
After rechecking all the configurations again and again I finally found a little typo in my containers resolv.conf.
After adjusting it to the right nameserver, it finally works now.

share|improve this answer

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.