PDA

View Full Version : Can't ping hostname


satimis
17th September 2008, 10:26
Hi folks,


Debian Etch
Xen


Guests created with xen-create-image can be pinged on Host either on hostname or on local ip. They can also be ssh-connected on both.

But Guests cloned on existing Guests can't be pinged on hostname. It can be pinged on local ip. Also can only be ssh-connected on local ip.

Please advise where I have to check and how to fix the problem. TIA


B.R.
satimis

falko
18th September 2008, 19:42
I think the problem is the MAC address - the cloned machines have the same MAC addresses as the original ones.

satimis
19th September 2008, 08:48
I think the problem is the MAC address - the cloned machines have the same MAC addresses as the original ones.
Hi falko,


How to fix the problem. TIA


Debian Etch (both Host and Guest)
Xen


Performed following test without result;

# dd if=/vserver/domains/xen5.satimis.com/disk.img of=/vserver/domains/xen6.satimis.com/disk.img bs=4k


# dd if=/vserver/domains/xen5.satimis.com/swap.img of=/vserver/domains/xen6.satimis.com/swap.img bs=4k


# xm list --long xen5.satimis.com
(domain
(domid 3)
(on_crash restart)
(uuid e1074e82-9bbc-8fcd-2e74-e6ab66a3017d)
(bootloader_args )
(vcpus 1)
(name xen5.satimis.com)
(on_poweroff destroy)
(on_reboot restart)
(bootloader )
(maxmem 32)
(memory 32)
(shadow_memory 0)
(cpu_weight 256)
(cpu_cap 0)
(features )
(on_xend_start ignore)
(on_xend_stop ignore)
(start_time 1221791564.86)
(cpu_time 3.132796221)
(online_vcpus 1)
(image
(linux
(kernel /boot/vmlinuz-2.6.18-xen)
(args 'root=/dev/hda1 ro ')
(rtc_timeoffset 0)
(notes
(HV_START_LOW 4227858432)
(FEATURES
'writable_page_tables|writable_descriptor_tables|a uto_translated_physmap|pae_pgdir_above_4gb|supervi sor_mode_kernel'
)
(VIRT_BASE 3221225472)
(GUEST_VERSION 2.6)
(PADDR_OFFSET 3221225472)
(GUEST_OS linux)
(HYPERCALL_PAGE 3222278144)
(LOADER generic)
(SUSPEND_CANCEL 1)
(PAE_MODE no)
(ENTRY 3222274048)
(XEN_VERSION xen-3.0)
)
)
)
(status 2)
(state -b----)
(store_mfn 899538)
(console_mfn 899537)
(device
(vif
(uuid 18904eab-6d22-da74-79f0-c86198a01e4a)
(script vif-bridge)
(ip 192.168.0.115)
(mac 00:16:3e:32:ab:e7)
(type netfront)
(backend 0)
)
)
(device
(vbd
(uname file:/vserver/domains/xen5.satimis.com/disk.img)
(uuid 505962e1-ddc4-7987-e731-eeda038c8ba1)
(mode w)
(dev hda1:disk)
(backend 0)
(bootable 1)
)
)
(device
(vbd
(uname file:/vserver/domains/xen5.satimis.com/swap.img)
(uuid c7e5ed00-fa70-3683-d66f-fba6feff5a69)
(mode w)
(dev hda2:disk)
(backend 0)
(bootable 0)
)
)
(device
(console
(protocol vt100)
(location 2)
(uuid ca9ca5fb-9cee-6571-d064-83e2d8ddd894)
)
)
)



# xm list --long xen6.satimis.com
(domain
(domid 2)
(on_crash restart)
(uuid 07a8b42b-acfd-ec79-ce19-83f843564db1)
(bootloader_args )
(vcpus 1)
(name xen6.satimis.com)
(on_poweroff destroy)
(on_reboot restart)
(bootloader )
(maxmem 32)
(memory 32)
(shadow_memory 0)
(cpu_weight 256)
(cpu_cap 0)
(features )
(on_xend_start ignore)
(on_xend_stop ignore)
(start_time 1221791309.54)
(cpu_time 3.313863599)
(online_vcpus 1)
(image
(linux
(kernel /boot/vmlinuz-2.6.18-xen)
(args 'root=/dev/hda1 ro ')
(rtc_timeoffset 0)
(notes
(HV_START_LOW 4227858432)
(FEATURES
'writable_page_tables|writable_descriptor_tables|a uto_translated_physmap|pae_pgdir_above_4gb|supervi sor_mode_kernel'
)
(VIRT_BASE 3221225472)
(GUEST_VERSION 2.6)
(PADDR_OFFSET 3221225472)
(GUEST_OS linux)
(HYPERCALL_PAGE 3222278144)
(LOADER generic)
(SUSPEND_CANCEL 1)
(PAE_MODE no)
(ENTRY 3222274048)
(XEN_VERSION xen-3.0)
)
)
)
(status 2)
(state -b----)
(store_mfn 888274)
(console_mfn 888273)
(device
(vif
(uuid bbc3e77d-e001-90f2-73f6-1d2a042c6e2b)
(script vif-bridge)
(ip 192.168.0.116)
(mac 00:16:3e:0a:c0:fb)
(type netfront)
(backend 0)
)
)
(device
(vbd
(uname file:/vserver/domains/xen6.satimis.com/disk.img)
(uuid 8ea4ccb1-212e-8fea-0b17-dc056ae7f75d)
(mode w)
(dev hda1:disk)
(backend 0)
(bootable 1)
)
)
(device
(vbd
(uname file:/vserver/domains/xen6.satimis.com/swap.img)
(uuid 182adee0-bc90-69f2-a7e5-19fc3656e1ac)
(mode w)
(dev hda2:disk)
(backend 0)
(bootable 0)
)
)
(device
(console
(protocol vt100)
(location 2)
(uuid dca93d80-8087-ed35-587d-dded9e45684f)
)
)
)



MAC Address

xen5.satimis.com :-
(mac 00:16:3e:32:ab:e7)


xen6.satimis.com
(mac 00:16:3e:0a:c0:fb)


# nano /etc/network/interfaces
making following change


iface eth0 inet static
address 192.168.0.116 = mac 00:16:3e:0a:c0:fb
gateway 192.168.0.1
netmask 255.255.255.0



Remark:-

Also tried;
address 192.168.0.116 = MAC of mac 00:16:3e:0a:c0:fb
address 192.168.0.116 = 00:16:3e:0a:c0:fb
address 192.168.0.116 = MAC of 00:16:3e:0a:c0:fb



None of them worked.


# /etc/init.d/networking restart
Reconfiguring network interfaces...=: Host name lookup failure
ifconfig: `--help' gives usage information.
Failed to bring up eth0.
done.



# ifconfig
eth0 Link encap:Ethernet HWaddr 00:16:3E:0A:C0:FB
inet addr:192.168.0.116 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::216:3eff:fe0a:c0fb/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:37 errors:0 dropped:0 overruns:0 frame:0
TX packets:31 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3154 (3.0 KiB) TX bytes:3138 (3.0 KiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)




B.R.
satimis

falko
20th September 2008, 13:59
You must change the MAC address in the vif line of the domU xen config file.

satimis
21st September 2008, 13:49
You must change the MAC address in the vif line of the domU xen config file.
Hi falko,


It has been changed already. It is local IP address.


I copied domU "xen5.satimis.com.cfg" as "xen6.satimis.com.cfg" running;


# cp -p /etc/xen/xen5.satimis.com.cfg /etc/xen/xen6.satimis.com.cfg


and made following changes;

1)
changing
disk = [ 'file:/vserver/domains/xen5.satimis.com/disk.img,hda1,w', 'file:/vserver/domains/xen5.satimis.com/swap.img,hda2,w' ]


as
disk = [ 'file:/vserver/domains/xen6.satimis.com/disk.img,hda1,w', 'file:/vserver/domains/xen6.satimis.com/swap.img,hda2,w' ]



2)
changing
name = 'xen5.satimis.com'


as:
name = 'xen6.satimis.com'



3)
changing
vif = [ 'ip=192.168.0.115' ]



as
vif = [ 'ip=192.168.0.116' ]



B.R.
satimis

falko
22nd September 2008, 14:06
I'm not talking about IP addresses, but about MAC addresses. Please add a MAC address to the vif line of the cloned VM, like so:

vif = [ 'ip=192.168.0.116 , mac=00:16:3E:C2:AA:77' ]

satimis
22nd September 2008, 15:44
I'm not talking about IP addresses, but about MAC addresses. Please add a MAC address to the vif line of the cloned VM, like so:

vif = [ 'ip=192.168.0.116 , mac=00:16:3E:C2:AA:77' ]
Hi falko,


Still fail to ping hostname after adding the MAC address as advised. I added the MAC address after stopping domU xen4.satimis.com. Re-started it also including reboot the PC.


$ cat /etc/xen/xen4.satimis.com.cfg
# Configuration file for the Xen instance xen1.satimis.com, created on
# Sat Sep 13 04:43:17 2008.

# Kernel + memory size
#
kernel = '/boot/vmlinuz-2.6.18-xen'

memory = '32'

# Disk device(s).

root = '/dev/hda1 ro'

disk = ['file:/vserver/domains/xen4.satimis.com/disk.img,hda1,w', 'file:/vserver/domains/xen4.satimis.com/swap.img,hda2,w']


# Hostname

name = 'xen4.satimis.com'

# Networking

vif = ['ip=192.168.0.114, mac=00:16:3E:C2:AA:77']

# Behaviour

on_poweroff = 'destroy'
on_reboot = 'restart'
on_crash = 'restart'



What I suspect is I haven't finished installing Xen. I followed your howto installing Xen;

http://www.howtoforge.com/debian_etch_xen_3.1


I stopped after completing p6;

http://www.howtoforge.com/debian_etch_xen_3.1_p6


without proceeding "5.5 Create A Virtual Local Network From The Virtual Machines (Optional)" on p7.


However if my suspicion established why other domUs created with "xen-create-image" don't have problem on pinging hostname. Anyway I'll complete p7 later to see what will happen.


Remark:
It came to my notice that MAC address is NOT static. It'll change on reboot.


B.R.
satimis

chipsafts
23rd September 2008, 16:36
What is the ifconfig dump for the original?

What is the ifconfig dump for the image?

satimis
23rd September 2008, 17:26
What is the ifconfig dump for the original?

What is the ifconfig dump for the image?
Hi chipsafts,


DumU-1 (xen5.satimis.com) - original

# ifconfig
eth0 Link encap:Ethernet HWaddr 00:16:3E:67:C3:AD
inet addr:192.168.0.115 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::216:3eff:fe67:c3ad/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:986 errors:0 dropped:0 overruns:0 frame:0
TX packets:637 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:468555 (457.5 KiB) TX bytes:72217 (70.5 KiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)



DumU-2 (xen6.satimis.com) - cloned guest

# sudo ifconfig
eth0 Link encap:Ethernet HWaddr 00:16:3E:2E:40:B6
inet addr:192.168.0.116 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::216:3eff:fe2e:40b6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:852 errors:0 dropped:0 overruns:0 frame:0
TX packets:524 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:77091 (75.2 KiB) TX bytes:94184 (91.9 KiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)



B.R.
satimis