Why VM cannot get the public IP I have from provider?
I have a KVM-Host (on Debian) with
root@kvm-host:/# cat /etc/network/interfaces
auto eth0
iface eth0 inet manual
auto vmbr0
iface vmbr0 inet static
address 176.x.y.133
netmask 255.255.255.224
gateway 176.x.y.129 # Provider's GW IP
bridge_ports eth0
bridge_stp off
bridge_fd 0
root@kvm-host:/# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
176.x.y.128 0.0.0.0 255.255.255.224 U 0 0 0 vmbr0
0.0.0.0 176.x.y.129 0.0.0.0 UG 0 0 0 vmbr0
root@kvm-host:/# arp -an
? (176.x.y.155) at <incomplete> on vmbr0
? (176.x.y.129) at xx:yy:zz:11:22:33 [ether] on vmbr0
root@kvm-host:/# ifconfig
1: lo: ...
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether AA:BB:CC:DD:EE:FF brd ff:ff:ff:ff:ff:ff
inet6 fe80::a60:6eff:feDD:EEFF/64 scope link
valid_lft forever preferred_lft forever
3: vmbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
link/ether AA:BB:CC:DD:EE:FF brd ff:ff:ff:ff:ff:ff
inet 176.x.y.133/27 brd 176.x.y.159 scope global vmbr0
inet6 fe80::a60:6eff:feDD:EEFF/64 scope link
valid_lft forever preferred_lft forever
4: venet0: <BROADCAST,POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
link/void
inet6 fe80::1/128 scope link
valid_lft forever preferred_lft forever
I have public IPs: 176.x.y.133 (KVM-Host), 176.x.y.151, 176.x.y.155.
Now I'm trying to get the network on each VM:
user@VM:/$ cat /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 176.x.y.155
netmask 255.255.255.255
pointtopoint 176.x.y.133
gateway 176.x.y.133
I uninstalled the network-manager.
Next steps:
user@VM:/$ sudo ifup eth0
RTNETLINK answers: File exists
Failed to bring up eth0
user@VM:/$ ping 176.x.y.133
connect: Network is unreachable
root@VM:/# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
(i.e. empty, no even default gateway)
user@VM:/$ sudo add default via 176.x.y.133
RTNETLINK answers: no such process
user@VM:/$ sudo arp -a
(i.e. empty)
user@VM:/$ sudo arp -s 176.x.y.133 AA:BB:CC:DD:EE:FF
SIOCSARP Network is unreachable
I can't even set static routes (MAC-addr./IP-addr.).
What could be the problem to set a network on the VM? (I hope I provided all the needed information to be specific)
Check that the MAC address is not randomly generated; many ISPs will only allocate IPs to MAC addresses that are issued by valid providers. I was able to get an IP on a machine by taking a known-good one, incrementing the last octet by one.
Edit: make sure "brctl show vmbr0" shows something sensible. Something like
xen-br0 8000.90b11c316da4 no eth0