OpenVZ Forum


Home » General » Support » my 1st VPS doesnt see the Internet !!
icon4.gif  my 1st VPS doesnt see the Internet !! [message #46243] Sat, 05 May 2012 14:55 Go to next message
HuMaN-BiEnG is currently offline  HuMaN-BiEnG
Messages: 10
Registered: May 2012
Location: Egypt
Junior Member
Hello there,

i have created my 1st vps whose IP address = HN IP address & have a not valid hostname which is set to "vps.test.com"

i have also set name servers for the VPS like name servers in /etc/resolv.conf for main HN

now when i enter to the VPS & test internet connection by using
ping yahoo.com 


it gives me error which is
ping: unknown host yahoo.com



so where is the problem please ???

please all accept my best regards,,
Re: my 1st VPS doesnt see the Internet !! [message #46258 is a reply to message #46243] Sat, 05 May 2012 18:49 Go to previous messageGo to next message
dzimi is currently offline  dzimi
Messages: 22
Registered: December 2008
Junior Member
Your setup won't work. Use private IP address for your VPS and then create a SNAT or MASQ for your private IP.

Like:

iptables -A POSTROUTING -t nat -o eth0 -s YOUR_PRIVE_IP -j SNAT --to YOUR_PUBLIC_IP

don't forget to switch ip_forwarding to 1
Re: my 1st VPS doesnt see the Internet !! [message #46259 is a reply to message #46258] Sun, 06 May 2012 14:42 Go to previous message
HuMaN-BiEnG is currently offline  HuMaN-BiEnG
Messages: 10
Registered: May 2012
Location: Egypt
Junior Member
dzimi wrote on Sat, 05 May 2012 14:49
Your setup won't work. Use private IP address for your VPS and then create a SNAT or MASQ for your private IP.

Like:

iptables -A POSTROUTING -t nat -o eth0 -s YOUR_PRIVE_IP -j SNAT --to YOUR_PUBLIC_IP

don't forget to switch ip_forwarding to 1


Hello dzimi,

first thank you man for your kind reply

why it wont work ?

is it because itsnt allowed to use HN IP in a vps ?

should i have to use SNAT ? because we just want to use public IP addresses for each VPS ?

ps, i have already enabled ip forwarding in the main HN

please accept my best regards,,



Previous Topic: which kernel to install
Next Topic: how to prevent vps from abusing HN resources !!
Goto Forum:
  


Current Time: Mon Nov 11 12:14:13 GMT 2024

Total time taken to generate the page: 0.03399 seconds