Hello.
(Sorry for possible duplicate - seems previout mail was dropped
somewhere, cannot find it on http://list.linux-vserver.org/archive/vserver/)
When I try to connect to guest virtual machine IP address from
outside, connection goes to host machine, and I cannot connect to
guest at all. Details are attached below.
I installed linux-vserver over CentOS 4 x86_64 according strictly
to instructions here:
http://linux-vserver.org/CentOS_HowTo
I used the following create command:
# vserver hosting build -m yum --hostname hosting --interface hosting=eth0:213.248.62.106/24 --initstyle sysv --context 500 --force -- -d centos4
So, guest OS ("hosting") has assigned IP 213.248.62.106
Host machine ("delta") has IP address 213.248.62.107 on eth0.
Something goes wrong with networking.
[root@delta 00]# vserver hosting start
Starting system logger: [ OK ]
Starting kernel logger: [ OK ]
[root@delta 00]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:30:48:75:13:D2
inet addr:213.248.62.107 Bcast:213.248.62.255 Mask:255.255.255.0
inet6 addr: fe80::230:48ff:fe75:13d2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:322664 errors:0 dropped:0 overruns:0 frame:0
TX packets:2134 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:20858801 (19.8 MiB) TX bytes:233103 (227.6 KiB)
Base address:0x3000 Memory:dd300000-dd320000
eth0:host Link encap:Ethernet HWaddr 00:30:48:75:13:D2
inet addr:213.248.62.106 Bcast:213.248.62.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Base address:0x3000 Memory:dd300000-dd320000
You see, 213.248.62.106 was added as alias to eth0. Maybe it is
OK, let's go forward:
[root@delta 00]# vserver hosting enter
[root@hosting /]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:30:48:75:13:D2
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:323267 errors:0 dropped:0 overruns:0 frame:0
TX packets:2175 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:20898570 (19.9 MiB) TX bytes:238393 (232.8 KiB)
Base address:0x3000 Memory:dd300000-dd320000
eth0:host Link encap:Ethernet HWaddr 00:30:48:75:13:D2
inet addr:213.248.62.106 Bcast:213.248.62.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Base address:0x3000 Memory:dd300000-dd320000
You see, IP address in guest OS is OK - 213.248.62.106. And -
Internet from virtual machine is fully accessible, I can use yum,
for example.
But, when I try to connect to guest IP (213.248.62.106) from
outside (from other machines in Internet), I really connect to
HOST machine, NOT to virtual! It is very, very strange!
Moreover,
[root@hosting /]# telnet 127.0.0.1 22
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
SSH-1.99-OpenSSH_3.9p1
You see, I connected from virtual machine to 127.0.0.1, SSH port,
and answer was - OK. So, I connected to HOST machine AGAIN,
because virtual machine does not have SSH server at all.
127.0.0.1 in GUEST OS connects us to HOST machine? Strange, very
strange!
What do I do incorrectly?
P.S.
I also tried to remove /etc/vservers/hosting/interfaces/00/name
(it contains "hosting", guest name). After that there is NO alias
213.248.62.106 in host machine ifconfig, but - also there is NO
ifconfig output in GUEST OS. I tried
service network start
in GUEST machine, creating
/etc/sysconfig/network-scripts/ifcfg-eth0 file before, but -
when I run "service network start" in guest, I have error message
about "already used interface 213.248.62.106".
At last, I tried to remove /etc/vservers/hosting/interfaces/00/
totally and operate /etc/sysconfig/network-scripts/ifcfg-eth0
in guest only, but - it does not work too ("service network
start" finished OK, but following ifconfig shows nothing).
Please tell how to configure networking in linux-vserver, to be
able to connect to virtual machine from outside.
-- B.r, Dmitry Koteroff Chief programmer, http://host-ing.ru _______________________________________________ Vserver mailing list Vserver@list.linux-vserver.org http://list.linux-vserver.org/mailman/listinfo/vserverReceived on Sat Nov 12 10:11:27 2005