[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] Xen xl toolstack on Debian 7.3.0; can't ssh to VM



On 21/01/14 00:56, Dale Mellor wrote:
> I've got DOM0 and DOMU running (both Debian 7.3.0 AMD64), and can use
> both individually and can `ssh localhost` on both with the expected
> results.  I am setting up the networking by hand to understand how it
> all goes.  The problem comes down to, no matter what I try, if I `ssh
> w.x.y.z` on DOM0 in the hope of having a shell on DOMU, I always end up
> with a shell on DOM0; the vif-bridge does not seem to carry the traffic
> across and in to the DOMU.
>
> Could someone describe the simplest setup which would achieve this,
> using just the `xl`, `ip`, `brctl` and `iptables` commands please?
>
>
> To be more concrete and provide maybe a starting point, here's a setup
> I'm currently trying:
>
>     ===/etc/xen/s1-0-2=============================
>
>     name="s1-0-2"
>     memory=2048
>     kernel='/root/s1-0-2--vmlinuz'
>     ramdisk='/root/s1-0-2--initrd'
>     extra='root=/dev/xvda1 -- console=hvc0'
>     e820_host=1
>     disk = [ 'phy:/dev/roots/s1-0-2,xvda,w' ]
>     vif=[ 'mac=02:12:12:12:12:02,bridge=s1-0-2' ]
>     vfb = [ 'type=vnc,vncdisplay=2' ]
>     vnc=1
>     stdvga=1
>
>     ===============================================
>
>
> And then on DOM0 (eth1 is a physical interface without a wire plugged
> into it):
>
>     echo 1 > /proc/sys/net/ipv4/ip_forward
>     iptables -t nat -I POSTROUTING -j MASQUERADE
This should not be needed, no nat... just ip routing to start with.
>     brctl addbr s1-0-2
>     brctl addif s1-0-2 eth1
>     xl create /etc/xen/s1-0-2
>     ip add add 10.133.33.3/24 dev eth1
Add the IP to the bridge s1-0-2 instead of the physical interface in the
bridge. Make sure you created the bridge before you started the domU.
> working on the DOMU console:
>
>     ip add add 10.133.33.3/24 dev eth0
>     ip route add default via 10.133.33.3 dev eth0
Use a different IP address for the domU compared to the dom0, eg
10.133.33.4, the second line (route) is not needed just for testing, but
might be useful later (you might also need NAT or similar depending on
the rest of your network config.
> and then when back on DOM0 I do
>
>     ssh 10.133.33.3
>
> I get a shell prompt on DOM0, whereas I would hope for a shell prompt on
> DOMU.
That is the IP configured on the dom0, therefore that is what you will
connect to. If you try this on the domU, then it should connect to the
domU (which also has the same IP configured on it).

Use a different IP for each machine (on the same subnet) and it should
work properly.

Regards,
Adam

If it still fails, send the output of:
for the dom0
brctl show

for both the dom0 and domU
ifconfig -a
route -n
iptables -L -v -n (actually, just make sure you have no iptables rules
at all until you get the basics working).

Hope this helps.

Regards,
Adam

-- 
Adam Goryachev
Website Managers
www.websitemanagers.com.au


_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxx
http://lists.xen.org/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.