Vserver help

Discussion in 'Installation/Configuration' started by myekel, Mar 4, 2006.

  1. myekel

    myekel New Member

    I have recently installed sarge via net install using the 2.6 kernel, then i patched the kernel with the vserver

    i made a vserver and started it, then i copied my apt lists to it but when i enter the vserver i cannot use anything over the net like ping or apt-get

    apt-get update says connecting and times out
     
  2. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    What's in
    Code:
    /etc/resolv.conf
    in the vserver, and what's the output of
    Code:
    ifconfig
    on the vserver?

    Did you use Xen or the Linux Vserver project?
     
  3. myekel

    myekel New Member

    I am using Linux Vserver project

    in the vserver :

    /etc/resolv.conf

    search anikast.net
    nameserver 10.100.2.5
    nameserver 198.235.216.130

    ------

    ifconfig

    eth0 Link encap:Ethernet HWaddr 00:05:5D:F3:CE:B9
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:372 errors:0 dropped:0 overruns:0 frame:0
    TX packets:255 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:37165 (36.2 KiB) TX bytes:22810 (22.2 KiB)
    Interrupt:10 Base address:0xe800
     
  4. myekel

    myekel New Member

    Any ideas what my problem may be?
     
  5. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    What's the output of
    Code:
    ping -c4 www.google.com
    and

    Code:
    ping -c4 216.239.59.99
    ?
     
  6. myekel

    myekel New Member

    from root :

    # ping -c4 www.google.com
    PING www.l.google.com (72.14.203.99) 56(84) bytes of data.
    64 bytes from 72.14.203.99: icmp_seq=1 ttl=237 time=642 ms
    64 bytes from 72.14.203.99: icmp_seq=2 ttl=237 time=1401 ms
    64 bytes from 72.14.203.99: icmp_seq=3 ttl=237 time=1579 ms
    64 bytes from 72.14.203.99: icmp_seq=4 ttl=237 time=596 ms

    --- www.l.google.com ping statistics ---
    4 packets transmitted, 4 received, 0% packet loss, time 5271ms
    rtt min/avg/max/mdev = 596.416/1055.014/1579.659/440.593 ms, pipe 2


    # ping -c4 216.239.59.99
    PING 216.239.59.99 (216.239.59.99) 56(84) bytes of data.
    64 bytes from 216.239.59.99: icmp_seq=1 ttl=234 time=912 ms
    64 bytes from 216.239.59.99: icmp_seq=2 ttl=235 time=1010 ms
    64 bytes from 216.239.59.99: icmp_seq=3 ttl=235 time=729 ms
    64 bytes from 216.239.59.99: icmp_seq=4 ttl=235 time=709 ms

    --- 216.239.59.99 ping statistics ---
    4 packets transmitted, 4 received, 0% packet loss, time 2999ms
    rtt min/avg/max/mdev = 709.748/840.319/1010.176/125.942 ms, pipe 2


    -------

    from the vserver:

    # ping -c4 www.google.com
    ping: unknown host www.google.com


    # ping -c4 216.239.59.99
    PING 216.239.59.99 (216.239.59.99) 56(84) bytes of data.

    --- 216.239.59.99 ping statistics ---
    4 packets transmitted, 0 received, 100% packet loss, time 2999ms
     
  7. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    Ok, it doesn't seem to be a DNS problem as pinging the IP address doesn't work either.
    It really seems as if you don't have a network connection. I had this problem as well with the Linux Vserver project (and haven't found a solution yet...).
    But maybe it's only your firewall. Please post the output of
    Code:
    iptables -L
    on your vserver and also on the host system.
    Can you ping the vserver from the host system and vice versa?
     
  8. myekel

    myekel New Member

    host:

    # iptables -L
    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




    # ping -c4 192.168.2.1
    PING 192.168.2.1 (192.168.2.1) 56(84) bytes of data.
    64 bytes from 192.168.2.1: icmp_seq=1 ttl=64 time=0.094 ms
    64 bytes from 192.168.2.1: icmp_seq=2 ttl=64 time=0.067 ms
    64 bytes from 192.168.2.1: icmp_seq=3 ttl=64 time=0.069 ms
    64 bytes from 192.168.2.1: icmp_seq=4 ttl=64 time=0.064 ms

    --- 192.168.2.1 ping statistics ---
    4 packets transmitted, 4 received, 0% packet loss, time 3000ms
    rtt min/avg/max/mdev = 0.064/0.073/0.094/0.014 ms



    ----



    vserver:

    # iptables -L
    bash: iptables: command not found


    # ping -c4 192.168.1.130
    PING 192.168.1.130 (192.168.1.130) 56(84) bytes of data.
    64 bytes from 192.168.1.130: icmp_seq=1 ttl=64 time=0.120 ms
    64 bytes from 192.168.1.130: icmp_seq=2 ttl=64 time=0.075 ms
    64 bytes from 192.168.1.130: icmp_seq=3 ttl=64 time=0.069 ms
    64 bytes from 192.168.1.130: icmp_seq=4 ttl=64 time=0.069 ms

    --- 192.168.1.130 ping statistics ---
    4 packets transmitted, 4 received, 0% packet loss, time 2999ms
    rtt min/avg/max/mdev = 0.069/0.083/0.120/0.022 ms
     
  9. myekel

    myekel New Member

    i got it to work:

    iptables -t nat -A POSTROUTING -s 192.168.2.1 -j SNAT --to-source 192.168.1.130

    external pings and apt-get update work now
     
  10. myekel

    myekel New Member

    so now my question is can you have a webserver or any kind of server running in more than one vserver if so how would i make it so when you goto

    www.domain.com it goes to vserver 1 or if i goto
    test.domain.com it goes to vserver 2
     
  11. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    This is possible if your vservers all have public IP addresses - you'd just have to create the appropriate DNS records.

    However, you seem to use private IP addresses. In this scenario it's not possible. This is the same as if you have a router, and behind that router you have a local network with your servers. You can forward port 80 from your router to only one server, not to multiple servers.
     

Share This Page