How to give fixed IPs to guests (accessible from outside of host)?

Serge Hallyn serge.hallyn at ubuntu.com
Thu Mar 13 17:07:46 UTC 2014


Quoting Peng Yu (pengyu.ut at gmail.com):
> Hi Serge,
> 
> I have br0 correctly set up on my host.
> 
> ifconfig br0
> br0       Link encap:Ethernet  HWaddr c8:1f:66:e2:90:49
>           inet addr:175.91.242.203  Bcast:175.91.247.255  Mask:255.255.248.0
>           inet6 addr: fe80::ca1f:66ff:fee2:9049/64 Scope:Link
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:2738640 errors:0 dropped:4197 overruns:0 frame:0
>           TX packets:211133 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:0
>           RX bytes:548029766 (548.0 MB)  TX bytes:149502426 (149.5 MB)

What does 'brctl show' show?

> Do you think this is a local network setup issue? Or a setup issue on
> the host? Thanks.

I'm not sure, so let's see if you can manually get a kvm machine on the
network over br0.  Try:

sudo tunctl
   (presumably this creates tap0;  if something higher, substitute that
   for tap0 below)
sudo ifconfig tap0 0.0.0.0 up
sudo brctl addif br0 tap0
wget http://archive.ubuntu.com/ubuntu/dists/trusty/main/installer-amd64/current/images/netboot/mini.iso
sudo kvm -cdrom mini.sio -m 1024 -net nic,model=virtio -net tap,ifname=tap0,script=no,downscript=no

Make sure the installer gets a network address, and make sure it is a
valid address for a peer to your host (i.e. perhaps 192.168.1.x,
or for me it was 10.42.43.23 when the host was 10.42.43.16, and the
gateway is 10.42.43.1)

-serge




More information about the ubuntu-server mailing list