How to create bridged network interface for Xen?

  • In your first network config em2 is configured to use the static method. In your second one it's set to manual. Using manual, the options you set afterwards don't get applied, hence you lost access.
  • Your machine is connected physically to the network via em2. You want to create a bridge called xenbr0, so you need to set em2 to manual (what you did), set xenbr0 to static (like em2 was before, instead of dhcp) and move all the options from em2 to xenbr0.
  • So, try this:

    # The loopback network interface
    auto lo
    iface lo inet loopback
    
    #xen
    auto xenbr0
    iface xenbr0 inet static
           address 68.65.120.34
           netmask 255.255.255.224
           network 68.65.120.32
           broadcast 68.65.120.63
           gateway 68.65.120.33
           # dns-* options are implemented by the resolvconf package, if installed
           dns-nameservers 68.65.120.33 8.8.8.8 4.4.2.2
           dns-search web-hosting.com
           bridge_ports em2
    
    # The primary network interface
    auto em2
    iface em2 inet manual
    
  • There are some more options you could set, especially in a virtualized environment:

           bridge_stp off       # disable Spanning Tree Protocol
           bridge_waitport 0    # no delay before a port becomes available
           bridge_fd 0          # no forwarding delay