1

我正在尝试在 Fedora-19(64 位操作系统)上使用以下命令在沙箱中创建和启动 apache 实例。

virt-sandbox-service create -C -N dhcp,source=default -s static,label=system_u:system_r:svirt_lxc_net_t:s0:c1,c2 -u httpd.service apache1

virt-sandbox-service start apache1

这会正确创建和启动(apache),但是它没有在 eth0 上获得 IP 地址,只有环回地址。如何配置沙盒网络并连接到这个 apache 实例到/从外部网络?

关于我的主机系统的信息:

#ifconfig virbr0
virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:6c:ea:ed  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

#brctl show
bridge name bridge id       STP enabled interfaces
virbr0      8000.5254006ceaed   yes     virbr0-nic

#virsh net-list
 Name                 State      Autostart     Persistent
----------------------------------------------------------
 default              active     yes           yes

#virsh net-dumpxml default
<network>
  <name>default</name>
  <uuid>d507981a-cbd8-47c4-8ba1-fb20496a25a7</uuid>
  <forward mode='nat'>
    <nat>
      <port start='1024' end='65535'/>
    </nat>
  </forward>
  <bridge name='virbr0' stp='on' delay='0' />
  <mac address='52:54:00:6c:ea:ed'/>
  <ip address='192.168.122.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.122.2' end='192.168.122.254' />
    </dhcp>
  </ip>
</network>

注意:我没有创建这个桥。这是由虚拟机管理器自动创建和配置的。

有关创建的沙箱的信息:

#virt-sandbox-service connect apache1
sh-4.2# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::5054:ff:feaa:e2c3  prefixlen 64  scopeid 0x20<link>
        ether 52:54:00:aa:e2:c3  txqueuelen 1000  (Ethernet)
        RX packets 33  bytes 2232 (2.1 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 8  bytes 648 (648.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

似乎网桥只配置了 ipv4,沙盒只配置了 ipv6。请任何人都可以告诉如何将桥配置为 ipv6 或将沙箱配置为 ipv4。我认为它可能会解决我的问题。

4

0 回答 0