I'm trying to setup a Xen virtualization on Ubuntu 16.04, and Xen 4.6.
My plan is to have 1 private network, as well as virtual servers with public IP addresses which should be accessible externally (as well as connected to the private network). My hosting provider gives me 4 additional public IPs.
For this, I've setup two bridges:
# brctl show bridge name bridge id STP enabled interfaces xenbr0 8000.0025907784d4 no eth0 vif3.0 vif3.0-emu xenbr1 8000.36829b44377f no dummy0 vif3.1 vif3.1-emu
xenbr0 has the public static IP, and xenbr1 a private one (192.168.122.1)
I've then configured the virtual machine as follows
vif=[ 'ip=<virtual server public ip>,mac=02:00:00:c1:fb:49,bridge=xenbr0', 'ip=192.168.122.6,mac=00:16:3E:59:FC:39,bridge=xenbr1' ]
I can connect to the 192.168.122.6 address just fine, and that machine has access to the internet correctly configured through the 192.168.122.1 gateway. So everything is good there.
I then add the public IP in /etc/network/interfaces on the virtual server
auto eth0 iface eth0 inet static address <public ip> netmask 255.255.255.255 network <public ip substituting .0 at the end> broadcast <public ip> hwaddress ether 02:00:00:c1:fb:49
And the internal network (which has the gateway)
iface eth1 inet static address 192.168.122.6 netmask 255.255.255.0 network 192.168.122.0 broadcast 192.168.122.255 gateway 192.168.122.1
Now the route looks like this
Destination Gateway Genmask Flags Metric Ref Use Iface default 192.168.122.1 0.0.0.0 UG 0 0 0 eth1 192.168.122.0 * 255.255.255.0 U 0 0 0 eth1
I can ping the IP from the server itself obviously - but I can't connect to it externally, or from the xen server itself.
What am I doing wrong?