OpenVZ Forum


Home » International » Russian » *SOLVED* venet, "connect: Invalid argument"
*SOLVED* venet, "connect: Invalid argument" [message #33292] Sat, 04 October 2008 19:04 Go to next message
sHaggY_caT is currently offline  sHaggY_caT
Messages: 144
Registered: August 2008
Location: Moscow, Russian Federatio...
Senior Member

Извиняюсь, если тема уже поднималась.
Честно юзала поиск, причем, не только по этому ресурсу.

Прошу помощи по настройке venet-сетки

Удалось найти кое-что только у альтоводов:

* http://lists.altlinux.org/pipermail/sysadmins/2006-August/00 7752.html

HN:

[shaggycat@hn scripts]$ cat /etc/redhat-release
CentOS release 5.2 (Final)

[shaggycat@hn scripts]$ uname -a
Linux hn 2.6.18-92.1.1.el5.028stab057.2 #1 SMP Mon Jul 21 20:55:45 MSD 2008 i686 i686 i386 GNU/Linux

[shaggycat@hn scripts]$ rpm -qa | grep vz | grep -v vztmpl-
ovzkernel-2.6.18-92.1.1.el5.028stab057.2
vzrpm44-4.4.1-22.5
vzrpm43-python-4.3.3-7_nonptl.6
vzdump-1.0-2
ovzkernel-devel-2.6.18-92.1.1.el5.028stab057.2
vzctl-lib-3.0.22-1
vzctl-3.0.22-1
vzyum-2.4.0-11
vzrpm44-python-4.4.1-22.5
vzrpm43-4.3.3-7_nonptl.6
vzquota-3.0.11-1
vzpkg-2.7.0-18

[shaggycat@hn scripts]$ cat /etc/sysctl.conf | grep -v "#"
net.ipv4.ip_forward = 1
net.ipv4.conf.default.proxy_arp = 0
net.ipv4.conf.all.rp_filter = 1
kernel.sysrq = 1
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0
kernel.sysrq = 1
net.ipv4.conf.default.forwarding=1
net.ipv4.conf.all.forwarding=1


Если нужно что-то еще из информации по ПО, уточню.

Машина используется как HomeServer. Кое-что для дома (VPS-ки p2p-качалка с mldonkey, nfs-шара(через unfsd), и тд) и как очень дешевый вариант выделенного сервера под web и прочее (все-таки дата-центр дорогое удовольствие, а инет в Москве хороший)

Из домашней локалки(два десктопа, КПК, иногда ноутбук, один из интерфейсов ноды):

10.0.5.0/24

Соединение с любой VPS устанавливается успешно. Я юзаю несколько подсеток:

[shaggycat@hn scripts]$ ip r ls
10.0.10.20 dev venet0  scope link  src 10.0.5.10
10.0.10.3 dev venet0  scope link  src 10.0.5.10
10.0.9.26 dev venet0  scope link  src 10.0.5.10
10.0.10.2 dev venet0  scope link  src 10.0.5.10
10.0.9.21 dev venet0  scope link  src 10.0.5.10
10.0.9.20 dev venet0  scope link  src 10.0.5.10
10.0.10.10 dev venet0  scope link  src 10.0.5.10
10.0.5.0/24 dev eth1  proto kernel  scope link  src 10.0.5.10
xx.xx.xx.xx/24 dev eth0  proto kernel  scope link  src xx.xx.xx.xx
169.254.0.0/16 dev venet0  scope link
default via xx.xx.xx.xx dev eth0


Здесь xx.xx.xx.xx статический внешний IP.

Так же, успешно проходят соединения через проброшенные(iptables PREROUTING) с внешного IP порты на различные VPS (то есть, работает web-server, "морда" mldonkey, и т.д.)

VPS друг друга успешно пингуют(обмениваются файлами по scp, и т д), даже если находятся в разных подсетях:

[root@test_centos_2 ~]# ifconfig venet0:0
venet0:0  Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:10.0.9.26  P-t-P:10.0.9.26  Bcast:10.0.9.26  Mask:255.255.255.255
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
[root@test_centos_2 ~]# ping -c 1 10.0.10.2
PING 10.0.10.2 (10.0.10.2) 56(84) bytes of data.
64 bytes from 10.0.10.2: icmp_seq=1 ttl=64 time=0.131 ms

--- 10.0.10.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.131/0.131/0.131/0.000 ms


Но вот если они попытаются пинговать что-то в подсетке 10.0.5.0/24, например, компьютер, с которого я написала этот текст, получается какая-то бяка:

[root@test_centos_2 ~]# ping 10.0.5.2
connect: Invalid argument
[root@test_centos_2 ~]#
[root@test_centos_2 ~]# ping 10.0.5.10
connect: Invalid argument  


То есть, не пингуется даже нода.

З.Ы. На VPS такой routing:

[root@test_centos_2 ~]# ip r ls
10.0.5.0/24 dev venet0  scope host
169.254.0.0/16 dev venet0  scope link
default via 10.0.5.10 dev venet0
[root@test_centos_2 ~]#


Подскажите, пожалуйста, куда, хотя бы, гуглить?

Буду благодарна любой помощи:)



IT-outsource for UNIX servers,
http://ha-systems.ru

[Updated on: Fri, 31 October 2008 09:45]

Report message to a moderator

Re: venet, "connect: Invalid argument" [message #33315 is a reply to message #33292] Tue, 07 October 2008 13:12 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Здравствуйте, а можете пострейсить программу ping, чтобы посмотреть, когда возвращается EINVAL?

http://wiki.openvz.org/Stracing_a_program
Re: venet, "connect: Invalid argument" [message #33326 is a reply to message #33292] Tue, 07 October 2008 19:35 Go to previous messageGo to next message
sHaggY_caT is currently offline  sHaggY_caT
Messages: 144
Registered: August 2008
Location: Moscow, Russian Federatio...
Senior Member

Запустила strace без рекомендованных параметров(не успела разобраться, простите, если критично, перезапощу).

[root@test-lamp ~]# strace ping 10.0.5.10
execve("/bin/ping", ["ping", "10.0.5.10"], [/* 20 vars */]) = 0
brk(0)                                  = 0x8616000
uname({sys="Linux", node="test-lamp.loc", ...}) = 0
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=12998, ...}) = 0
mmap2(NULL, 12998, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7fe7000
close(3)                                = 0
open("/lib/libresolv.so.2", O_RDONLY)   = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\300 \0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=74616, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fe6000
mmap2(NULL, 75976, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x9c7000
mmap2(0x9d6000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xe) = 0x9d6000
mmap2(0x9d8000, 6344, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x9d8000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0000_\1\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1594552, ...}) = 0
mmap2(NULL, 1320356, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x187000
mmap2(0x2c4000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13c) = 0x2c4000
mmap2(0x2c7000, 9636, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2c7000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fe5000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7fe56c0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
mprotect(0x2c4000, 8192, PROT_READ)     = 0
mprotect(0x9d6000, 4096, PROT_READ)     = 0
mprotect(0x39c000, 4096, PROT_READ)     = 0
munmap(0xb7fe7000, 12998)               = 0
socket(PF_INET, SOCK_RAW, IPPROTO_ICMP) = 3
getuid32()                              = 0
setuid32(0)                             = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 4
connect(4, {sa_family=AF_INET, sin_port=htons(1025), sin_addr=inet_addr("10.0.5.10")}, 16) = -1 EINVAL (Invalid argument)
dup(2)                                  = 5
fcntl64(5, F_GETFL)                     = 0x8002 (flags O_RDWR|O_LARGEFILE)
brk(0)                                  = 0x8616000
brk(0x8637000)                          = 0x8637000
fstat64(5, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fea000
_llseek(5, 0, 0xbff1b324, SEEK_CUR)     = -1 ESPIPE (Illegal seek)
write(5, "connect: Invalid argument\n", 26connect: Invalid argument
) = 26
close(5)                                = 0
munmap(0xb7fea000, 4096)                = 0
exit_group(2)                           = ?
[root@test-lamp ~]# strace ping 10.0.5.10
execve("/bin/ping", ["ping", "10.0.5.10"], [/* 20 vars */]) = 0
brk(0)                                  = 0x8885000
uname({sys="Linux", node="test-lamp.loc", ...}) = 0
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=12998, ...}) = 0
mmap2(NULL, 12998, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7f78000
close(3)                                = 0
open("/lib/libresolv.so.2", O_RDONLY)   = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\300 \0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=74616, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f77000
mmap2(NULL, 75976, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x373000
mmap2(0x382000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xe) = 0x382000
mmap2(0x384000, 6344, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x384000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0000_\1\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1594552, ...}) = 0
mmap2(NULL, 1320356, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fd000
mmap2(0x93a000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13c) = 0x93a000
mmap2(0x93d000, 9636, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x93d000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f76000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7f766c0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
mprotect(0x93a000, 8192, PROT_READ)     = 0
mprotect(0x382000, 4096, PROT_READ)     = 0
mprotect(0xf47000, 4096, PROT_READ)     = 0
munmap(0xb7f78000, 12998)               = 0
socket(PF_INET, SOCK_RAW, IPPROTO_ICMP) = 3
getuid32()                              = 0
setuid32(0)                             = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 4
connect(4, {sa_family=AF_INET, sin_port=htons(1025), sin_addr=inet_addr("10.0.5.10")}, 16) = -1 EINVAL (Invalid argument)
dup(2)                                  = 5
fcntl64(5, F_GETFL)                     = 0x8002 (flags O_RDWR|O_LARGEFILE)
brk(0)                                  = 0x8885000
brk(0x88a6000)                          = 0x88a6000
fstat64(5, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f7b000
_llseek(5, 0, 0xbf839c44, SEEK_CUR)     = -1 ESPIPE (Illegal seek)
write(5, "connect: Invalid argument\n", 26connect: Invalid argument
) = 26
close(5)                                = 0
munmap(0xb7f7b000, 4096)                = 0
exit_group(2)                           = ?
[root@test-lamp ~]#             


Это трейс пинга до ноды.

А это diff трейса этого пинга с пингом до воркстанции:

[root@test-lamp ~]# diff 10.0.5.10 10.0.5.2
2c2
< brk(0)                                  = 0x8cb5000
---
> brk(0)                                  = 0x8949000
7c7
< mmap2(NULL, 12998, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7f48000
---
> mmap2(NULL, 12998, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7fb4000
12,15c12,15
< mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f47000
< mmap2(NULL, 75976, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x8ab000
< mmap2(0x8ba000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xe) = 0x8ba000
< mmap2(0x8bc000, 6344, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x8bc000
---
> mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fb3000
> mmap2(NULL, 75976, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x308000
> mmap2(0x317000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xe) = 0x317000
> mmap2(0x319000, 6344, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x319000
20,22c20,22
< mmap2(NULL, 1320356, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xe69000
< mmap2(0xfa6000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13c) = 0xfa6000
< mmap2(0xfa9000, 9636, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xfa9000
---
> mmap2(NULL, 1320356, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x110000
> mmap2(0x24d000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13c) = 0x24d000
> mmap2(0x250000, 9636, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x250000
24,29c24,29
< mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f46000
< set_thread_area({entry_number:-1 -> 6, base_addr:0xb7f466c0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
< mprotect(0xfa6000, 8192, PROT_READ)     = 0
< mprotect(0x8ba000, 4096, PROT_READ)     = 0
< mprotect(0x89b000, 4096, PROT_READ)     = 0
< munmap(0xb7f48000, 12998)               = 0
---
> mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fb2000
> set_thread_area({entry_number:-1 -> 6, base_addr:0xb7fb26c0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
> mprotect(0x24d000, 8192, PROT_READ)     = 0
> mprotect(0x317000, 4096, PROT_READ)     = 0
> mprotect(0xdd7000, 4096, PROT_READ)     = 0
> munmap(0xb7fb4000, 12998)               = 0
[root@test-lamp ~]#                    


Спасибо, что помогаете!


IT-outsource for UNIX servers,
http://ha-systems.ru

[Updated on: Wed, 08 October 2008 04:54]

Report message to a moderator

Re: venet, "connect: Invalid argument" [message #33339 is a reply to message #33326] Wed, 08 October 2008 10:44 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Quote:


[root@test_centos_2 ~]# ip r ls
10.0.5.0/24 dev venet0  scope host
169.254.0.0/16 dev venet0  scope link
default via 10.0.5.10 dev venet0
[root@test_centos_2 ~]#




Проблема в "10.0.5.0/24 dev venet0 scope host", а точнее "scope host". Из "man ip"
Quote:


host - the address is valid only inside this host.


Поставьте "scope link".
Вам не нужно прописывать routing внутри VPS, достаточно иметь default маршрут на venet0 интерфес.
Re: venet, "connect: Invalid argument" [message #33508 is a reply to message #33339] Sat, 18 October 2008 18:54 Go to previous message
sHaggY_caT is currently offline  sHaggY_caT
Messages: 144
Registered: August 2008
Location: Moscow, Russian Federatio...
Senior Member

Спасибо большое Smile
Извините, что сразу не поблагодарила, просто замоталась...


IT-outsource for UNIX servers,
http://ha-systems.ru
Previous Topic: Стоит ли связываться с HyperVM ?
Next Topic: Совместимость openvz и virtuozzo
Goto Forum:
  


Current Time: Fri Feb 03 16:03:34 GMT 2023

Total time taken to generate the page: 0.01037 seconds