MirageOS和Xen - 虚拟接口无法获取IP地址

时间:2016-02-12 15:15:48

标签: network-programming dhcp xen mirage

我按照本指南https://github.com/mirage/mirage-www/blob/master/tmpl/wiki/hello-world.md编译并构建了XEN的MirageOS unikernel(主要是最后一部分,第4步, stackv4 )但是在我启动之后我无法通过DHCP发现阶段,如以下日志所示:

Parsing config from stackv4.xl
Xen Minimal OS!
Initialising console ... done.
getenv(OCAMLRUNPARAM) -> null
getenv(CAMLRUNPARAM) -> null
getenv(PATH) -> null
Unsupported function lseek called in Mini-OS kernel
Unsupported function lseek called in Mini-OS kernel
Unsupported function lseek called in Mini-OS kernel
getenv(OCAMLRUNPARAM) -> null
getenv(CAMLRUNPARAM) -> null
getenv(TMPDIR) -> null
getenv(TEMP) -> null
Netif: add resume hook
Netif.connect 0
Netfront.create: id=0 domid=0
 sg:true gso_tcpv4:true rx_copy:true rx_flip:false smart_poll:false
MAC: 00:16:3e:7e:c0:0d
Attempt to open(/dev/urandom)!
Unsupported function getpid called in Mini-OS kernel
Unsupported function getppid called in Mini-OS kernel
Manager: connect
Manager: configuring
DHCP: start discovery

Sending DHCP broadcast (length 552)
DHCP: start discovery

Sending DHCP broadcast (length 552)
DHCP: start discovery

Sending DHCP broadcast (length 552)
DHCP: start discovery

....

我的MirageOS unikernel配置:

name = 'stackv4'
kernel = '/home/mirage/mirage-skeleton/stackv4/mir-stackv4.xen'
builder = 'linux'
memory = 256
on_crash = 'preserve'

disk = [  ]

# if your system uses openvswitch then either edit /etc/xen/xl.conf and set
#     vif.default.script="vif-openvswitch"
# or add "script=vif-openvswitch," before the "bridge=" below:
vif = [ 'bridge=xenbr0' ]

我的网络配置:

eth0      Link encap:Ethernet  HWaddr 02:01:06:02:83:c0
          inet6 addr: fe80::1:6ff:fe02:83c0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:110876 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14602 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:9736700 (9.7 MB)  TX bytes:1999992 (1.9 MB)
          Interrupt:117

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:65536  Metric:1
          RX packets:384394 errors:0 dropped:0 overruns:0 frame:0
          TX packets:384394 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:26761500 (26.7 MB)  TX bytes:26761500 (26.7 MB)

vif16.0   Link encap:Ethernet  HWaddr fe:ff:ff:ff:ff:ff
          inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:58 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11289 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:32
          RX bytes:33640 (33.6 KB)  TX bytes:778590 (778.5 KB)

xenbr0    Link encap:Ethernet  HWaddr 02:01:06:02:83:c0
          inet addr:131.159.24.167  Bcast:131.159.25.255  Mask:255.255.254.0
          inet6 addr: fe80::1:6ff:fe02:83c0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:110689 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11987 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:8328727 (8.3 MB)  TX bytes:1703101 (1.7 MB)

我的网桥配置:

bridge name     bridge id               STP enabled     interfaces
xenbr0          8000.0201060283c0       no              eth0
                                                        vif16.0

我的/ etc / network / interface:

auto lo
iface lo inet loopback

auto eth0
#iface eth0 inet dhcp
#  up ip link set eth0 up

iface eth0 inet manual

auto xenbr0
    iface xenbr0 inet dhcp
            bridge_ports eth0

我试图了解问题是什么,但一切似乎都是正确的(根据其他指南http://wiki.xen.org/wiki/Network_Configuration_Examples_(Xen_4.1%2B)#Example_Debian-style_bridge_configuration_.28e.g._Debian.2C_Ubuntu.29)。

1 个答案:

答案 0 :(得分:3)

一些建议:

  1. 检查您实际运行的是DHCP服务器。
  2. 在桥机上运行tcpdumpwireshark(可能是dom0),看看有什么流量。你看到DHCP请求了吗?
  3. 尝试配置静态IP地址,看看是否有效。
  4. 尝试运行Linux来宾并查看DHCP是否在那里工作(并比较数据包捕获)。