OpenVZ Forum


Home » General » Support » Re: Can't resolve host address within container [SOLVED]
icon9.gif  Re: Can't resolve host address within container [SOLVED] [message #42863] Sat, 11 June 2011 13:22 Go to previous message
plotinus is currently offline  plotinus
Messages: 11
Registered: June 2011
Junior Member
Hi all,
First of all, I apologyze for my poor english Embarassed
I am a total newbie and I am desperated.
I've installed openVZ in a centOS 5.6, I can work with containers but i can't resolve any internet address within containers.
I just can ping, but when I make a wget, I always receive a wget: unable to resolve host address "google.com" message.
I've read lots of forums and messages, but I've found no solution. I'm not an expert in linux, nor networks.
I create the containers as follows:

  • vzctl create 101 --ostemplate fedora-14-x86_64
  • vzctl set 101 --ipadd 192.168.1.101
  • vzctl set 101 --nameserver 62.14.4.64 --nameserver 62.14.4.65



My /etc/sysctl.conf file:
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) and
# sysctl.conf(5) for more details.

# Controls IP packet forwarding
net.ipv4.ip_forward = 1

net.ipv4.conf.default.forwarding = 1

net.ipv4.conf.all.forwarding = 1

net.ipv4.conf.default.proxy_arp = 0

# Controls source route verification
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.all.rp_filter = 1

# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0

net.ipv4.conf.default.send_redirects = 1

net.ipv4.conf.all.send_redirects = 0

# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 1

# Controls whether core dumps will append the PID to the core filename
# Useful for debugging multi-threaded applications
kernel.core_uses_pid = 1

# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1

# Controls the maximum size of a message, in bytes
kernel.msgmnb = 65536

# Controls the default maxmimum size of a mesage queue
kernel.msgmax = 65536

# Controls the maximum shared segment size, in bytes
kernel.shmmax = 68719476736

# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 4294967296


My /etc/resolv.conf file:
nameserver 62.14.4.64
nameserver 62.14.4.65


Result of ifconfig:
eth0      Link encap:Ethernet  HWaddr 00:1E:90:E5:B8:22  
          inet addr:192.168.1.12  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::21e:90ff:fee5:b822/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:449 errors:0 dropped:0 overruns:0 frame:0
          TX packets:311 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:45496 (44.4 KiB)  TX bytes:65981 (64.4 KiB)
          Interrupt:233 Base address:0xc000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:560 (560.0 b)  TX bytes:560 (560.0 b)

venet0    Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet6 addr: fe80::1/128 Scope:Link
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

virbr0    Link encap:Ethernet  HWaddr 00:00:00:00:00:00  
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:39 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:6913 (6.7 KiB)

Please can anyone help me? I don't know what can I do, I'm testing and changing without direction.
Thanks for your interest!

Added:
I tested:
ifconfig venet0 192.168.1.102 netmask 255.255.255.0 broadcast 192.168.1.255
and container 102 wgot web pages!
Only for the first time... never more!

[Updated on: Thu, 16 June 2011 21:43]

Report message to a moderator

 
Read Message icon9.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message icon14.gif
Read Message
Previous Topic: container can't not access to the Internet
Next Topic: Ploop mount/umount issue
Goto Forum:
  


Current Time: Tue Jun 24 15:26:46 GMT 2025

Total time taken to generate the page: 0.05369 seconds