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.

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  --  *      *       0.0.0.0/0            IP_ADDRESS          tcp dpt:8090 to:192.168.1.100:80

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

IP_ADDRESS being the hosts/servers ip address, 192.168.1.100 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

1 Answer 1

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

 
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.