| Xen network bridges & private LANs [message #39857] |
Fri, 03 October 2008 22:53  |
porvin  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   |
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.
|
|
|
|
|
|