Subject: Re: [vserver] Re: New guy needs a little help
From: Jason Drage <jasond@ibsglobalweb.com>
Date: Wed, 10 Sep 2008 13:25:18 +1000

Caleb Call wrote:
> I have already tried copying over my /etc/resolv.conf from teh host
> with no luck.  Also what's in my /etc/resolv.conf on the guest is
> identical to my host.
>
> I have changed the /etc/ssh/sshd_config to only listen to one of my
> IPs (I have two static IPs on this box).  I also do not have any DNS
> services running on the host.  It's a co-located server that is used
> strictly for web hosting.
>
> The method I used (exact command) is:  vserver default build -m yum
> --context 42 --hostname default.oxygen --interface
> eth0:192.168.1.11/24 <http://192.168.1.11/24> -- -d centos5
> I wanted the guest named default, I plan for it to be my "base" for
> all my other guests.  I also tried using a template method using a
> template from sandino.  The command I used to build that one was:
> server tmachine build -m template --hostname tmachine --interface
> eth0:10.0.200.2/24 <http://10.0.200.2/24> -- -d centos5 -t
> /vservers/.templates/centos-5-i686-2008-07-07.tar.bz2.  It built
> correctly as well but I ended up with the exact same results.
>
> *ip addr ls output from*
> *host - *
> 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 <http://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:14:d1:10:0d:c4 brd ff:ff:ff:ff:ff:ff
>     inet 209.17.191.189/23 <http://209.17.191.189/23> brd
> 209.17.191.255 <http://209.17.191.255> scope global eth0
>     inet 209.17.191.190/30 <http://209.17.191.190/30> brd
> 209.17.191.191 <http://209.17.191.191> scope global eth0
>     inet 192.168.1.11/24 <http://192.168.1.11/24> brd 192.168.1.255
> <http://192.168.1.255> scope global eth0
>     inet 209.17.191.190/23 <http://209.17.191.190/23> brd
> 209.17.191.255 <http://209.17.191.255> scope global secondary eth0:1
>     inet6 fe80::214:d1ff:fe10:dc4/64 scope link
>        valid_lft forever preferred_lft forever
>
>
> *guest - *
> 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 <http://127.0.0.1/8> scope host lo
> 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
> qlen 1000
>     link/ether 00:14:d1:10:0d:c4 brd ff:ff:ff:ff:ff:ff
>     inet 192.168.1.11/24 <http://192.168.1.11/24> brd 192.168.1.255
> <http://192.168.1.255> scope global eth0
>
> *output of vserver-info:*
> ersions:
>                    Kernel: 2.6.22.19-vs2.3.0.34.1
>                    VS-API: 0x00020302
>              util-vserver: 0.30.216-pre2772; Aug 25 2008, 01:17:19
>
> Features:
>                CC: gcc, gcc (GCC) 4.1.2 20071124 (Red Hat 4.1.2-42)
>                       CXX: g++, g++ (GCC) 4.1.2 20071124 (Red Hat
> 4.1.2-42)
>                  CPPFLAGS: ''
>                    CFLAGS: '-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2
> -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64
> -mtune=generic -std=c99 -Wall -pedantic -W -funit-at-a-time'
>                  CXXFLAGS: '-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2
> -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64
> -mtune=generic -ansi -Wall -pedantic -W -fmessage-length=0
> -funit-at-a-time'
>                build/host: x86_64-redhat-linux-gnu/x86_64-redhat-linux-gnu
>              Use dietlibc: yes
>        Build C++ programs: yes
>        Build C99 programs: yes
>            Available APIs: v13,net,v21,v22,v23,netv2
>             ext2fs Source: e2fsprogs
>     syscall(2) invocation: alternative
>       vserver(2) syscall#: 236/glibc
>                crypto api: beecrypt
>
> Paths:
>                    prefix: /usr
>         sysconf-Directory: /etc
>             cfg-Directory: /etc/vservers
>          initrd-Directory: /etc/rc.d/init.d
>        pkgstate-Directory: /var/run/vservers
>           vserver-Rootdir: /vservers
>
>
> Assumed 'SYSINFO' as no other option given; try '--help' for more
> information.
>
>
> *I appreciate the quick responses guys.  Thanks for any help.*
>
Hi Caleb,
My setup is a little different so what I'm about to mention may not be
applicable in you case, but...

Your networking setup look a bit odd.

Firstly in addition to your routable (i.e. real) ip addresses
209.17.191.x you have on the same physical interface configured a
private address range 192.168.1.11/24, this is unlikely to work without
additional trickery like iptables nat.

You've mentioned that you can ping via ip address, but what about any
tcp services? Can you connect to an external webserver using an ip
address from your guest?

On the machine I have with multiple network ranges, they all have
multiple physical interfaces configured with separate ranges.
Another possible issue is the /24 address you've assigned to the guest.
All my guests are specified with /32 (with the host performing any
inter-guest routing).

You could try building a guest with one of your 209.17.191.189/23
<http://209.17.191.189/23> addresses, if you happen to have one spare..

Or create some nat rules or a virtual switch


hth,
Jason





<http://209.17.191.190/30>