The Perfect Xen 3.0 Setup For Debian - Virtual Networking

Discussion in 'HOWTO-Related Questions' started by Mito, Apr 24, 2006.

  1. Mito

    Mito New Member

    Ok, well it looks like I'm not the only one having an issue with this HowTo, but my problem is a bit different than his.

    My problem is that I can't get the virtual networking to work at all! There is a slight difference though, I'm not running Debian, I'm running RedHat FC4 as my guest OS (this is due to a requirement of one of the software that I am running on this domU). Everything should be the same on page 6 though, reguardless of what linux distro you're using. No matter what I've done, I can't get it to work. I just posted to the Xen-Users mailing list for help as well, but have only gotten replies from people asking me to tell them how to fix it once I figure out how to fix it myself, which means I'm far from the only one with this problem!

    Is there anything anyone can suggest to help me figure out what's going on? The networking was working great until I tried to enable the NAT, and now it doesn't work at all (unless of course I change it back to bridged, which isn't going to be workable for me...).

    Thanks in advance for any help you can give!

    Mito
     
  2. falko

    falko Super Moderator

    What's the output of
    Code:
    ifconfig
    on dom0? Which iptables rules are you using? Can you post one of your vm configuration files here?
     
  3. Mito

    Mito New Member

    ifconfig on dom0
    Code:
    [root@xendom0 ~]# ifconfig
    eth0      Link encap:Ethernet  HWaddr 00:B0:D0:EA:49:75
              inet addr:192.168.200.30  Bcast:192.168.200.255  Mask:255.255.255.0
              inet6 addr: fe80::2b0:d0ff:feea:4975/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:72235 errors:0 dropped:0 overruns:0 frame:0
              TX packets:2787 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:6852932 (6.5 MiB)  TX bytes:477136 (465.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:37 errors:0 dropped:0 overruns:0 frame:0
              TX packets:37 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:5177 (5.0 KiB)  TX bytes:5177 (5.0 KiB)
    
    vif1.0    Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF
              inet addr:10.0.0.129  Bcast:0.0.0.0  Mask:255.255.255.255
              inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:616 errors:0 dropped:0 overruns:0 frame:0
              TX packets:66 errors:0 dropped:23 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:64804 (63.2 KiB)  TX bytes:2772 (2.7 KiB)
    
    
    xen domU config file
    Code:
    name = "mail"
    kernel = "/boot/vmlinuz-2.6.16-1.2096_FC5xenU"
    ramdisk = "/boot/initrd-2.6.16-1.2096_FC5xenU.img"
    memory = 416
    root = "/dev/sda1 ro"
    disk = ['file:/guests/mail-server.img,sda1,w', 'file:/guests/mail-server.swap,sda2,w']
    
    # Network Configuration
    vif=[ 'ip=10.0.0.2' ]
    dhcp="off"
    ip="10.0.0.2"
    netmask="255.0.0.0"
    gateway="10.0.0.254"
    hostname = "mail.mydomain.com"
    
    You'll note that the vif1.0 IP address on dom0 is not x.254 however, it's x.129. I did try that as the gateway as well, and it still didn't do any good. Also, I'm not sure what happened, but at some point in my troubleshooting, the changes that I made to the network settings in the config file stopped taking effect in the domU, and now I have to keep changing the settings inside the domU instead. Here is the ifcfg-eth0 file in the domU:
    Code:
    [root@mail ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
    DEVICE=eth0
    ONBOOT=yes
    TYPE=Ethernet
    NETMASK=255.255.0.0
    IPADDR=10.0.0.20
    GATEWAY=10.0.0.254
    
     
  4. falko

    falko Super Moderator

    Please add
    Code:
    extra="3"
    to the domU configuration file and restart the domU.
    extra="3" means runlevel 3. Maybe your domU is now in a runlevel where networking is not available.
     
  5. Mito

    Mito New Member

    I just added that line, and it didn't change anything.

    Just to note, the domU does apear to have functional networking, as it worked before I change the dom0 config to use the NAT scripts. Also, the domU can ping itself, just not anything else.

    Here's the domU's ifconfig
    Code:
    eth0      Link encap:Ethernet  HWaddr 00:16:3E:7B:F0:C3
              inet addr:10.0.0.20  Bcast:10.0.255.255  Mask:255.255.0.0
              inet6 addr: fe80::216:3eff:fe7b:f0c3/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:4 errors:0 dropped:0 overruns:0 frame:0
              TX packets:50 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:168 (168.0 b)  TX bytes:4695 (4.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:14 errors:0 dropped:0 overruns:0 frame:0
              TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:888 (888.0 b)  TX bytes:888 (888.0 b)
    
    Notice it's taking it's IP configuration from the ifcfg-eth0 file and not the xen config file. I don't know when that happened, but it happened when troubleshooting this problem.

    Thanks for any help you can give, I'm totally confused as to why this isn't working!
    Mito
     
  6. falko

    falko Super Moderator

    And when you remove the configuration from ifcfg-eth0, what's the output of
    Code:
    ifconfig
    then on domU?
     
  7. Mito

    Mito New Member

    Well, when I cleared it and restarted the network service, it gave me this error when starting:
    Code:
    Bringing up loopback interface:  [  OK  ]
    Bringing up interface eth0:  Usage: grep [OPTION]... PATTERN [FILE]...
    Try `grep --help' for more information.
    Usage: grep [OPTION]... PATTERN [FILE]...
    Try `grep --help' for more information.
    Missing config file ifcfg-ifcfg-eth0.
    [  OK  ]
    
    But then when I did ifconfig it gave me the same as before. So then I restarted domU and when starting the network services it gave the same error, and this time there was just the loopback device in ifconfig.

    So then I thought, maybe it doesn't refresh it's config file if it's rebooted, so instead of rebooting it, I shutdown domU then started it back up again. Yet again, the same errors when starting eth0 and just 'lo' as the network device:
    Code:
    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:8 errors:0 dropped:0 overruns:0 frame:0
              TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:560 (560.0 b)  TX bytes:560 (560.0 b)
    
    I just don't know what's going on...
     
  8. falko

    falko Super Moderator

    Maybe the domU kernel which was compiled on Debian doesn't work for Fedora...
     
  9. Mito

    Mito New Member

    I'm not using the debian kernel, I'm using the kernel that was supplied when I installed it...

    When I installed xen I used yum, by typing:
    Code:
    yum install xen kernel-xen0 kernel-xenU
    a friend of mine suggested that it's possible that the FC4 build of that kernel doesn't support NAT, so last night I started compiling xen from scratch, and then we'll see how that goes.
     
  10. falko

    falko Super Moderator

    I was thinking that you're using Debian on dom0, but obviously that's not the case.
     

Share This Page