OpenVZ Forum


Home » General » Support » Network Problem
icon9.gif  Network Problem [message #33847] Fri, 14 November 2008 15:30 Go to next message
pooyan is currently offline  pooyan
Messages: 3
Registered: November 2008
Location: Iran
Junior Member
Hello I have installed OpenVz on ubuntu and my Ve templates are Centos-4 .
I have little problem
I have installed VE and I add this ip 192.168.2.1 .
I want to add another valid address to this vps so I could access It from internet i tried everything but i couldn't solve it.
can you tell me how to add this static IP 83.147.250.101
to my vps to do this i should add a subnet of 255.255.254.0 and default gateway of 83.147.250.2 to connect to internet with my Ve.
i can connect to internet from my HN.
But my Ve dosen't work
thnx.
Re: Network Problem [message #33848 is a reply to message #33847] Fri, 14 November 2008 15:42 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hello,

first of all could you please specify the preferable interface which you are intend to use inside VE (venet or veth)?

in case of venet:
- you should set appropriate sysctl parameters as described for example here:

http://wiki.openvz.org/Quick_installation#sysctl

- to add 83.147.250.101 use standard "vzctl set $VEID --ipadd $IP --save" syntax (don't bother about netmask. Because you have default gateway pointing to venet0 inside VE every packet that's going out of your VE first of all reaches HN and you should set appropriate route on the HN (may be pointing to 83.147.250.2 or may be you already have such route on the HN and in this case you haven't to do additional steps))
Re: Network Problem [message #33850 is a reply to message #33848] Fri, 14 November 2008 18:55 Go to previous messageGo to next message
pooyan is currently offline  pooyan
Messages: 3
Registered: November 2008
Location: Iran
Junior Member
Hello again
I use Venet
I have added this setting to my /etc/sysctl.conf
but after I add 83.147.250.101 to my Ve But I can not access it from outside I don't know what is my problem.
it is my routing table

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.2.1 * 255.255.255.255 UH 0 0 0 venet0
83.147.250.101 * 255.255.255.255 UH 0 0 0 venet0
83.147.250.0 * 255.255.254.0 U 0 0 0 eth0
default 83.147.250.2 0.0.0.0 UG 100 0 0 eth0

I think you can help.
what do i need to change to connect it to internet?
it is better to know that eth0 is connected to internet
Re: Network Problem [message #33851 is a reply to message #33850] Fri, 14 November 2008 19:05 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hello,

1. First of all make sure that 83.147.250.101 is a valid ip address, i.e. it is workable and you are allowed to use it (this information should be obtained from your provider).

2. Make sure that you are able to get your VE from HN for example try to ping 83.147.250.101 from inside the HN. Is it possible?

3. Make sure that you have no iptables rules that may be a reason of the problem (either on the HN or inside the VE).

4. Please show "arp -n" from the HN.

5. Try to ping your VE from outside, at the same time run tcpdump on the HN on eth0 and venet0 interfaces and inside the VE on the venet interce and show the output please.

6. Also show "ip a l", "ip rule list", "ip r l" (from the HN and from inside the VE)
Re: Network Problem [message #33852 is a reply to message #33851] Fri, 14 November 2008 19:31 Go to previous messageGo to next message
pooyan is currently offline  pooyan
Messages: 3
Registered: November 2008
Location: Iran
Junior Member
1.it is a valid address and I have this range from 83.147.250.1 to 83.147.250.255 expect 83.147.250.2 as the gateway and 83.147.250.16 as my DNS server and i have set 83.147.250.190 for my HN and it is working from outside and i control it by SSH.

2.yes it is able to ping 83.147.250.101 from inside of the HN.
ping 83.147.250.101
PING 83.147.250.101 (83.147.250.101) 56(84) bytes of data.
64 bytes from 83.147.250.101: icmp_seq=1 ttl=64 time=0.160 ms
64 bytes from 83.147.250.101: icmp_seq=2 ttl=64 time=0.111 ms
64 bytes from 83.147.250.101: icmp_seq=3 ttl=64 time=0.108 ms
64 bytes from 83.147.250.101: icmp_seq=4 ttl=64 time=0.109 ms

3.iptables -L
sudo iptables -L
[sudo] password for pooyan:
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

4.ping 83.147.250.101
Pinging 83.147.250.101 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 83.147.250.101:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

5.I don't know how to it Sad

6.From HN
----root@ubuntu:/home/pooyan# ip a l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:17:9a:78:57:5e brd ff:ff:ff:ff:ff:ff
inet 83.147.250.190/23 brd 83.147.251.255 scope global eth0
inet6 fe80::217:9aff:fe78:575e/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
link/ether 00:15:e9:82:69:10 brd ff:ff:ff:ff:ff:ff
4: venet0: <BROADCAST,POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue
link/void
----root@ubuntu:/home/pooyan# ip rule list
0: from all lookup local
32766: from all lookup main
32767: from all lookup default

----root@ubuntu:/home/pooyan# ip r l
192.168.2.1 dev venet0 scope link
83.147.250.101 dev venet0 scope link
83.147.250.0/23 dev eth0 proto kernel scope link src 83.147.250.190
default via 83.147.250.2 dev eth0 metric 100

From Ve It self


-----[root@ubuntu ~]# ip a l
1: lo: <LOOPBACK,UP,10000> mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: venet0: <BROADCAST,POINTOPOINT,NOARP,UP,10000> mtu 1500 qdisc noqueue
link/void
inet 127.0.0.1/32 scope host venet0
inet 192.168.2.1/32 brd 192.168.2.1 scope global venet0:0
inet 83.147.250.101/32 brd 83.147.250.101 scope global venet0:1
inet 192.168.2.2/32 brd 192.168.2.2 scope global venet0:2

-----[root@ubuntu ~]# ip rule list
0: from all lookup local
32766: from all lookup main
32767: from all lookup default

----ip r l
192.0.2.0/24 dev venet0 scope host
169.254.0.0/16 dev venet0 scope link
default via 192.0.2.1 dev venet0


Re: Network Problem [message #33860 is a reply to message #33852] Mon, 17 November 2008 07:36 Go to previous message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hello,

I have a suspicion what could it be.

You have set several ip addresses to your VE and when a packet goes out of your VE it has to have a source ip address and it is set as "192.168.2.1". Of course, internet becomes unreachable.

Why do you need 192.168.2.1 and 192.168.2.2 ip addresses inside your VE?

To avoid this situation try to explicitly add appropriate routes inside VE for example:

# ip r del default
# ip r add 192.168.2.0/24 dev venet0 src 192.168.2.1
# ip r add default dev venet0 src 83.147.250.101


It's just an example. You can change it accordingly your purposes.

Previous Topic: Quota Help
Next Topic: Cannot Access Internet
Goto Forum:
  


Current Time: Sat May 04 06:08:22 GMT 2024

Total time taken to generate the page: 0.01664 seconds