LxCenter HyperVM & Kloxo Support

Forum



Members   Search      Help    Register    Login    Home
Home » LxCenter » Contributed HOWTOs » Xen network bridges & private LANs
Xen network bridges & private LANs [message #39857] Fri, 03 October 2008 22:53 Go to next message
porvin is currently offline porvin  United States
Messages: 33
Registered: January 2008
Location: San Francisco, CA
Member
A couple days ago I contacted LxHelp to give me advice on how to set up a separate Xen network bridge so that I could connect a customer Windows VPS to a local VLAN (for backups, clustering, etc). While a feature to do this through HyperVM is currently unavailable, LxHelp was able to help find a manual method.

By default, it seems that xen only enables one virtual interface, xenbr0: eth0 -> xenbr0. If your slaves have multiple network adapters you can utilize them on your VPSes. First create a script called network-multi-bridge to call the network bridge script twice and place it in /etc/xen/scripts/ :

#!/bin/sh
dir=$(dirname "$0")
"$dir/network-bridge" "$@" vifnum=0 bridge=xenbr0 netdev=eth0  
"$dir/network-bridge" "$@" vifnum=1 bridge=xenbr1 netdev=eth1


Be sure to make the script executable:

# chmod +x /etc/xen/scripts/network-multi-bridge

Now edit /etc/xen/xend-config.sxp and find the line (network-script network-bridge). Change it to (network-script network-multi-bridge) to call your own script. Restart the slave to initialize the node (haven't found a way without rebooting).

Now edit the config file for the VPS you want to add a virtual adapter to. All config files are found in /home/xen/vmname.vm on the slave. For example if I were to add an adapter to newserver.vm:

# nano /home/xen/newserver.vm/newserver.vm.cfg

Now find the line
vif = [ 'type=ioemu, vifname=vifibtm01,  mac=xx:xx:xx:xx:xx:01 ' ]


and replace it with:

vif = [ 'mac=xx:xx:xx:xx:xx:01, bridge=xenbr0', 'mac=xx:xx:xx:xx:xx:02, bridge=xenbr1' ]


Notice the MAC address was incremented by 1 on the second network bridge. Save the config file and run:

# chattr +i /home/xen/newserver.vm/newserver.vm.cfg

The last command is to prevent HyperVM from overwriting the config file when rebooting the VPS from the control panel. Now go into HyperVM and add an IP on your private LAN to newserver.vm: VPS Home > Ipaddresses > Add Directly. Reboot the VPS from control panel and SSH to the primary IP. If everything went right you should now be able to ping machines on your private LAN.

I'm not sure if this will work in the same way with a Linux VPS but with some tweaking it should be possible.

[Updated on: Sat, 04 October 2008 05:41] by Moderator

Report message to a moderator

Re: HOWTO: Xen network bridges & private LANs [message #39858 is a reply to message #39857] Fri, 03 October 2008 22:58 Go to previous messageGo to next message
Lxhelp
Messages: 23691
Registered: July 2006
The Champion
Please post this in the Third party howto forum, so that it won't get lost in all the help queries.

Also, note to moderators: If possible, please find the thirdparty howtos and move them to the how-to forum.

thanks.


On Sat, Oct 04, 2008 at 02:53:52AM -0000, Paul Orvin wrote:
>
>
> A couple days ago I contacted LxHelp to give me advice on how to set up a separate Xen network bridge so that I could connect a customer Windows VPS to a local VLAN (for backups, clustering, etc). While a feature to do this through HyperVM is currently unavailable, LxHelp was able to help find a manual method.
Re: HOWTO: Xen network bridges & private LANs [message #41028 is a reply to message #39858] Fri, 10 October 2008 11:51 Go to previous messageGo to next message
LxCenter_Danny is currently offline LxCenter_Danny  Netherlands
Messages: 2068
Registered: July 2007
Location: Netherlands
Grandmaster
LxCenter Core Team Member
LxCenter Representative

Lxhelp wrote on Sat, 04 October 2008 04:58


Also, note to moderators: If possible, please find the thirdparty howtos and move them to the how-to forum.



Noticed.




LxCenter - System Operations
Re: Xen network bridges & private LANs [message #46504 is a reply to message #39857] Mon, 17 November 2008 20:22 Go to previous messageGo to next message
aaron is currently offline aaron  Australia
Messages: 178
Registered: May 2007
Senior Member
This would be a GREAT feature to have included in HyperVM....

Re: Xen network bridges & private LANs [message #55997 is a reply to message #39857] Sat, 14 February 2009 13:54 Go to previous message
dalem is currently offline dalem  United States
Messages: 10
Registered: December 2008
Member
Quote:
I'm not sure if this will work in the same way with a Linux VPS but with some tweaking it should be possible.


yes it is possible:

all you have to do is add all the eth1 configurations manually
in /etc/sysconfig/network-scripts inside the VPS
Previous Topic:Xen based vps, not ping
Next Topic:migrate email accounts and emails message from fedora core 2 to CentOS5
Goto Forum:
  


Current Time: Mon May 20 17:59:07 EDT 2013

Total time taken to generate the page: 0.01170 seconds
.:: Contact :: Home :: Privacy ::.

Click here to lend your support to: LxCenter and make a donation at www.pledgie.com !

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software