Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Adding an Alias to Network Bridge

  1. #1

    Adding an Alias to Network Bridge


    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):

    # 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
        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
        gateway X.Y.62.118
    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.

    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

  2. #2
    Administrator Advisor peter's Avatar
    Join Date
    Apr 2004
    I've never tried this before, but I would think that with bridging you would have to define more than one ethernet interface somewhere.

  3. #3
    Yes, you're right. I thought the alias would be sufficient, but it wasn't.

    br0       Link encap:Ethernet  HWaddr 00:22:15:98:37:1a  
              inet addr:X.Y.61.18  Bcast:  Mask:
    vnet0     Link encap:Ethernet  HWaddr 16:ee:9a:43:ba:da  
              inet addr:X.Y.62.118  Bcast:  Mask:
    I now have a second (virtual) interface.

    $ brctl show
    bridge name    bridge id        STP enabled    interfaces
    br0        8000.00221598371a    no        eth0
    Bridge is setup.

    IP forwarding is enabled in sysctl.conf ...

    Yet I am not sure what to do now.

    Pinging gives me a "Destination Host Unreachable"

    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    X.Y.62.112      *      U     0      0        0 vnet0
    X.Y.61.0        *      U     0      0        0 br0   *        U     0      0        0 virbr0
    default         *              UG    100    0        0 br0
    Routing seems correct, but I am no expert.

    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.

  4. #4
    Administrator Advisor peter's Avatar
    Join Date
    Apr 2004
    What are you trying to ping? The default gateway doesn't seem to be defined, it should be pointing to the IP address of a router.

  5. #5
    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.

  6. #6
    Administrator Advisor peter's Avatar
    Join Date
    Apr 2004
    I'm not sure I understand. A bridge is a device on which all interfaces reside on the same subnet. Are you sure you don't want to configure routing?

  7. #7
    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.

  8. #8
    Quote Originally Posted by peter View Post
    A bridge is a device on which all interfaces reside on the same subnet.
    Actually, a bridge just forwards packets at the ethernet level so it doesn't care about the subnet or anything else. So I think my bridge should work with IP Forwarding enabled and the correct route.

    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

  9. #9
    I finally got it!

    It seems that the only way for me to add an alias to a bridge is manually.

    sudo ifconfig br0:0 X.Y.62.118 netmask broadcast X.Y.62.119
    With the br0 bridge set to the primary IP and IP forwarding enabled, it works like a charm

    Now I just have to automate it in some scripts and I should be good to go.

  10. #10
    Administrator Advisor peter's Avatar
    Join Date
    Apr 2004
    Excellent to hear! I was wondering why the interfaces file wouldn't work. Do you know of any other way to get it automated to work. I'd think the interfaces file would be the most fool proof.

Similar Threads

  1. Owner for the alias list in sendmail
    By honey bee in forum Linux - Software, Applications & Programming
    Replies: 0
    Last Post: 04-17-2007, 11:32 AM
  2. Qmail Alias with period
    By infinite_root in forum Linux - Hardware, Networking & Security
    Replies: 3
    Last Post: 01-16-2004, 07:51 AM
  3. Transparent bridge firewall
    By demian in forum Security
    Replies: 3
    Last Post: 10-29-2003, 01:54 PM
  4. network\ethernet bridge
    By sujoki in forum Linux - Hardware, Networking & Security
    Replies: 13
    Last Post: 09-11-2003, 01:27 AM
  5. alias for root
    By Black666 in forum Linux - General Topics
    Replies: 4
    Last Post: 06-25-2002, 02:46 PM


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts