OpenVZ Forum


Home » General » Support » *SOLVED* Can ping but not connect from a custom template
*SOLVED* Can ping but not connect from a custom template [message #23349] Thu, 15 November 2007 18:06 Go to next message
bmaisonn is currently offline  bmaisonn
Messages: 5
Registered: November 2007
Junior Member
Hi,
I've searched to resolve this problem for a long time Crying or Very Sad ! So now, i decide to share it Rolling Eyes .
For a project I had to make a custom template with buildroot and busybox.
I created a VE and gave him an ip address ( venet interface )
(vzctl create 103 --ostemplate linux --ipadd 192.168.254.103)
Next inside that VE i configured my interfaces with this script :

#!/bin/sh
ifconfig venet0 add 127.0.0.1 netmask 255.255.255.255 broadcast 0.0.0.0 up
ifconfig venet0:0 add 192.168.254.103 netmask 255.255.255.255 broadcast 0.0.0.0 up
route add -net 191.255.255.1 netmask 255.255.255.255 dev venet0
route add -net default gw 191.255.255.1

From here, i can ping the HN but can't connect to him through a tcp socket.

I'd like to know i a forgot something, or made something wrong ?

Thanks a lot !

[Updated on: Fri, 16 November 2007 13:15] by Moderator

Report message to a moderator

Re: Can ping but not connect from a custom template [message #23372 is a reply to message #23349] Fri, 16 November 2007 06:09 Go to previous messageGo to next message
vaverin is currently offline  vaverin
Messages: 708
Registered: September 2005
Senior Member
At the first glance your setup looks correct.
However I do not understand your problem. Could you please explain it in more details?

thank you,
Vasily Averin

Re: Can ping but not connect from a custom template [message #23378 is a reply to message #23372] Fri, 16 November 2007 09:10 Go to previous messageGo to next message
bmaisonn is currently offline  bmaisonn
Messages: 5
Registered: November 2007
Junior Member
Hi,
this is my situation.
I have a process on the HN which tries to communicate with another process placed in my custom VE through a tcp socket using the address 192.168.254.103 and a specific port. This configuration works perfectly with a minimal debian template, but with my template the two processes cannot even connect each other. There is certainly something that I forgot. Is there a special configuration for the loopback interface ?

Here is the result of an "ifconfig" command :

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  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)

venet0    Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:127.0.0.1  P-t-P:127.0.0.1  Bcast:0.0.0.0  Mask:255.255.255.255
          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)

venet0:0  Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:192.168.254.103  P-t-P:192.168.254.103  Bcast:0.0.0.0  Mask:255.255.255.255
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1


And the route configuration :

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
191.255.255.1   *               255.255.255.255 UH    0      0        0 venet0
default         191.255.255.1   0.0.0.0         UG    0      0        0 venet0


Thanks for interest to my problem Razz
Re: Can ping but not connect from a custom template [message #23389 is a reply to message #23378] Fri, 16 November 2007 10:20 Go to previous messageGo to next message
bmaisonn is currently offline  bmaisonn
Messages: 5
Registered: November 2007
Junior Member
I can precise my problem a little bit more.
We've discovered than we can use wget from the VE, so it's seems it's working in one way ( VE to outside).
Re: Can ping but not connect from a custom template [message #23402 is a reply to message #23389] Fri, 16 November 2007 11:13 Go to previous messageGo to next message
vaverin is currently offline  vaverin
Messages: 708
Registered: September 2005
Senior Member
bmaisonn wrote on Fri, 16 November 2007 13:20

I can precise my problem a little bit more.
We've discovered than we can use wget from the VE, so it's seems it's working in one way ( VE to outside).

Your have private IP and it can be acecssed only from your private network. Private IP's are not visible from internet.
Re: Can ping but not connect from a custom template [message #23403 is a reply to message #23378] Fri, 16 November 2007 11:18 Go to previous messageGo to next message
vaverin is currently offline  vaverin
Messages: 708
Registered: September 2005
Senior Member
I still cannot understand your ptoblem.
- are you able to ping HN from VE?
- are you able to ping VE from HN?
- are you able ssh from inside VE to HW node?
- if you have some server inside VE -- are you able connect him from inside VE and from HN?

I would add that tcpdump logs are very useful in such invetsigations.

thank you,
Vasily Averin
Re: Can ping but not connect from a custom template [message #23412 is a reply to message #23403] Fri, 16 November 2007 13:03 Go to previous message
bmaisonn is currently offline  bmaisonn
Messages: 5
Registered: November 2007
Junior Member
Victory !
there was an error in my application in the VE.
I am sorry if i've waste your time ...
Embarassed
Thanks
Previous Topic: How to configure quota
Next Topic: *SOLVED* IP ping works, DNS IP ping doesnt work
Goto Forum:
  


Current Time: Mon Jul 15 08:31:08 GMT 2024

Total time taken to generate the page: 0.02382 seconds