I've never tried this before, but I would think that with bridging you would have to define more than one ethernet interface somewhere.
I need a networking guru's help.
I am trying to setup a bridge and use virtual machines under Ubuntu Jaunty Server, but am having lots of troubles.
I am working remotely on my server through SSH, and as it is 3800 KMs away, I have no physical access.
This is my interfaces file (obviously, X and Y are valid numbers):
As it is, I can't access the server at all. It doesn't reply to ping, and logging in by SSH times out. Luckily, I wrote a script to change the interfaces file and reboot, so I can work with it some more.Code:# The loopback network interface auto lo iface lo inet loopback auto br0 iface br0 inet static address X.Y.61.18 network X.Y.61.0 netmask 255.255.255.224 broadcast X.Y.61.31 gateway X.Y.61.1 bridge_ports eth0 bridge_stp off bridge_maxwait 5 auto br0:0 iface br0:0 inet static address X.Y.62.118 netmask 255.255.255.248 gateway X.Y.62.118
If I comment out br0:0, it works fine.
Now, the data center where the server is located has given me the information which I used, with secondary IP addresses:
As I only have a gateway for the primary address, I need to fix the bridge to get it running.
Any suggestions? Thanks
Yes, you're right. I thought the alias would be sufficient, but it wasn't.
I now have a second (virtual) interface.Code:br0 Link encap:Ethernet HWaddr 00:22:15:98:37:1a inet addr:X.Y.61.18 Bcast:184.108.40.206 Mask:255.255.255.224 vnet0 Link encap:Ethernet HWaddr 16:ee:9a:43:ba:da inet addr:X.Y.62.118 Bcast:220.127.116.11 Mask:255.255.255.248
Bridge is setup.Code:$ brctl show bridge name bridge id STP enabled interfaces br0 8000.00221598371a no eth0 vnet0
IP forwarding is enabled in sysctl.conf ...
Yet I am not sure what to do now.
Pinging gives me a "Destination Host Unreachable"
Routing seems correct, but I am no expert.Code:Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface X.Y.62.112 * 255.255.255.248 U 0 0 0 vnet0 X.Y.61.0 * 255.255.255.224 U 0 0 0 br0 192.168.122.0 * 255.255.255.0 U 0 0 0 virbr0 default * 0.0.0.0 UG 100 0 0 br0
I tried setting my gateway on the virtual machine to the address of vnet0 (X.Y.62.118), and to the address I assigned it (X.Y.62.114). Nothing seems to work.
I also tried setting the VPS to the same IP address (.118). When I SSH'd into it, I was connected to the host and not the guest.
Any ideas, anyone? I hope there are a few networking gurus here, because I am really at a loss.
I'm trying to ping the VPS.
I set the default gateway for it when I built it using vmbuilder, as per these instructions:
I tried to set it to the address of vnet0, which should be forwarding to eth0 on the virtual machines. I also tried setting it to the address of eth0 on the virtual machine and to the address of br0, all to no avail.
The default gateway is set properly on the host system, as I can SSH into it, ping it, etc.
The gateway for the guest systems is what I am trying to figure out. To me, it should be set to vnet0, as vnet0 should be doing the routing, as they are virtual machines and cannot be linked to a physical router.
vnet0 should forward all requests from br0, which bridges the eth0 (physical) and vnet0 (virtual) adapters, to the eth0 adapters of the appropriate virtual machine.
The problem is that my secondary addresses and my primary address, for the virtual machines and the host system respecitvely are on a different subnet, and I need to get the routing to work properly for the virtual machines to be accessible.
I'm not sure of anything, at this point :P
Yeah, it probably is routing I'm struggling with. I tried to add another route to the table for the secondary network, but that didn't help.
I think what I may need is in fact a tunnel I can attach KVM to.
I also mounted the qcow2 disk image with nbd-client, so I can now read the log / configuration files in the virtual server. Hopefully, I will find something somewhere that eluded me
I finally got it!
It seems that the only way for me to add an alias to a bridge is manually.
With the br0 bridge set to the primary IP and IP forwarding enabled, it works like a charmCode:sudo ifconfig br0:0 X.Y.62.118 netmask 255.255.255.248 broadcast X.Y.62.119
Now I just have to automate it in some scripts and I should be good to go.