Newbie Question about network.. [message #38818] |
Thu, 04 February 2010 08:02 ![Go to next message Go to next message](/theme/ovz3/images/down.png) |
Lord Daedra
Messages: 5 Registered: February 2010 Location: Kolchugino
|
Junior Member |
|
|
Hello!
Host OS: Centos 5.4, VPS OS: Ubuntu 9.10.
I can't ping google.com on my VPS.
I used default Ubuntu template from this site, google nameserver 8.8.8.8 for VPS and ip 174.142.167.217.
vzctl create 217 --ostemplate ubuntu-9.10-x86 --ipadd 174.142.167.217 --hostname database.entropia.us --name database
vzctl set 217 --onboot yes --nameserver 8.8.8.8 --save
I need install public VEs (with their own IP addresses) so I'm look at http://wiki.openvz.org/Common_Networking_HOWTOs and use this command:
[host-node]# echo 1 > /proc/sys/net/ipv4/ip_forward
ifconfig on my host system:
Quote: | [root@cl-t127-072cl ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:30:48:B0:BA:D8
inet addr:67.205.67.10 Bcast:67.205.67.31 Mask:255.255.255.224
inet6 addr: fe80::230:48ff:feb0:bad8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:339100 errors:0 dropped:0 overruns:0 frame:0
TX packets:178932 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
RX bytes:492718192 (469.8 MiB) TX bytes:12945821 (12.3 MiB)
Memory:d0100000-d0120000
eth0:1 Link encap:Ethernet HWaddr 00:30:48:B0:BA:D8
inet addr:174.142.167.217 Bcast:174.142.167.223 Mask:255.255.255.248
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Memory:d0100000-d0120000
eth0:2 Link encap:Ethernet HWaddr 00:30:48:B0:BA:D8
inet addr:174.142.167.218 Bcast:174.142.167.223 Mask:255.255.255.248
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Memory:d0100000-d0120000
eth0:3 Link encap:Ethernet HWaddr 00:30:48:B0:BA:D8
inet addr:174.142.167.219 Bcast:174.142.167.223 Mask:255.255.255.248
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Memory:d0100000-d0120000
eth0:4 Link encap:Ethernet HWaddr 00:30:48:B0:BA:D8
inet addr:174.142.167.220 Bcast:174.142.167.223 Mask:255.255.255.248
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Memory:d0100000-d0120000
eth0:5 Link encap:Ethernet HWaddr 00:30:48:B0:BA:D8
inet addr:174.142.167.221 Bcast:174.142.167.223 Mask:255.255.255.248
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Memory:d0100000-d0120000
eth0:6 Link encap:Ethernet HWaddr 00:30:48:B0:BA:D8
inet addr:174.142.167.222 Bcast:174.142.167.223 Mask:255.255.255.248
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Memory:d0100000-d0120000
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:6 errors:0 dropped:0 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:504 (504.0 b) TX bytes:504 (504.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)
|
next i start and enter to my VPS and see ifconfig command blank result..
Info from datacenter:
Primary IP address : 67.205.67.10
Primary IP mask : 255.255.255.224
Gateway : 67.205.67.1
Usable secondary addresses: 174.142.167.217-222
Mask : 255.255.255.248
So also I replaced all 255.255.255.255 in /etc/vz/dists/scripts/debian-add_ip.sh to 255.255.255.248 in debian add ip script...
P.S.
[root@cl-t127-072cl ~]# ip rule list
0: from all lookup 255
32766: from all lookup main
32767: from all lookup default
[root@cl-t127-072cl ~]# iptables -t nat -L && iptables -t filter -L && iptables -t mangle -L
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
Please help me, where is my error?
|
|
|
|
Re: Newbie Question about network.. [message #38822 is a reply to message #38820] |
Thu, 04 February 2010 13:33 ![Go to previous message Go to previous message](/theme/ovz3/images/up.png) ![Go to next message Go to next message](/theme/ovz3/images/down.png) |
Lord Daedra
Messages: 5 Registered: February 2010 Location: Kolchugino
|
Junior Member |
|
|
I dont know what is better veth or venet.. what is more easy to install?
Ok, venet..
1. I need run
a) [host-node]# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
or
b) [host-node]# iptables -t nat -A POSTROUTING -o eth0:1 -j MASQUERADE
[host-node]# iptables -t nat -A POSTROUTING -o eth0:2 -j MASQUERADE
[host-node]# iptables -t nat -A POSTROUTING -o eth0:3 -j MASQUERADE
[host-node]# iptables -t nat -A POSTROUTING -o eth0:4 -j MASQUERADE
[host-node]# iptables -t nat -A POSTROUTING -o eth0:5 -j MASQUERADE
[host-node]# iptables -t nat -A POSTROUTING -o eth0:6 -j MASQUERADE
(for every IP)
?
I tried a) and reboot after - but it doesnt help for me
(Its from guide http://wiki.openvz.org/Common_Networking_HOWTOs )
2. Here http://forum.openvz.org/index.php?t=msg&&th=7188& ;amp ;amp ;goto=34847#msg_34847 I find this
route add default gw 192.168.1.1 dev eth0
I tried run this command in VPS but get error
root@database:/# route add default gw 67.205.67.1 dev eth0
SIOCADDRT: No such device
root@database:/# ifconfig
root@database:/#
Yes, I see what no devices but why they did not installed when I used "set 217 --ipadd 174.142.167.217 --save" and how to install them?
ifconfig return blank result but I dont know how to fix this..
root@database:/# cat /etc/network/interfaces
# This configuration file is auto-generated.
# WARNING: Do not edit this file, otherwise your changes will be lost.
# Please edit template /etc/network/interfaces.template instead.
auto lo
iface lo inet loopback
address 127.0.0.1
netmask 255.0.0.0
broadcast 127.255.255.255
up ip route replace 127.0.0.0/8 dev lo
# Auto generated interfaces
auto lo
iface lo inet loopback
auto venet0
iface venet0 inet static
address 127.0.0.1
netmask 255.255.255.248
broadcast 67.205.67.1
up route add -net 192.0.2.1 netmask 255.255.255.248 dev venet0
up route add default gw 192.0.2.1
auto venet0:0
iface venet0:0 inet static
address 174.142.167.217
netmask 255.255.255.248
broadcast 67.205.67.1
May be I need change smth in /etc/network/interfaces.template ?
Please tell me any easy way how to setup Internet connecton for my VPSes
P.S. On node:
[root@cl-t127-072cl ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
174.142.167.219 0.0.0.0 255.255.255.255 UH 0 0 0 venet0
174.142.167.218 0.0.0.0 255.255.255.255 UH 0 0 0 venet0
174.142.167.217 0.0.0.0 255.255.255.255 UH 0 0 0 venet0
174.142.167.216 0.0.0.0 255.255.255.248 U 0 0 0 eth0
67.205.67.0 0.0.0.0 255.255.255.224 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
0.0.0.0 67.205.67.1 0.0.0.0 UG 0 0 0 eth0
(3 VPSes)
[Updated on: Thu, 04 February 2010 13:38] Report message to a moderator
|
|
|
|
|
|
|
|