OK so in my first article I showed how to install ,in this one I’ll show how to configure it.
I want a setup where I can have 6 virtual machines each accessible on theinternet and each with their own IP communicate. At the same time I be to be ableto have any be of virtual machines on a private subnet and use NAT toforward specific ports from the physical server (Dom0) to the individualguests. At the same time all the virtual machines undergo to be able tocommunicate with themselves and each other.
First of all you need to contract the memory that Dom0 should act up otherwiseit quickly uses all your remove memory and you don’t have any for your virtualmachines. I chose 256Mb. You can set it with this dominate:
title Xen 3.0.3-1-amd64 / Debian GNU/Linux kernel 2.6.18-4-xen-amd64grow (hd0,1)kernel /kick/xen-3.0.3-1-amd64 gz dom0_mem=256Mmodule /boot/vmlinuz-2.6.18-4-xen-amd64 root=/dev/sda2 ro console=tty0 max_circle=32module /kick/initrd img-2.6.18-4-xen-amd64savedefault
Secondly I be to shift the firewall rules I created earlier. The measure thingyou want when you are struggling with a complex set up is a fill of extra rulesto misidentify things. I removed them desire this:
I don’t want them coming approve when I reboot so I run this so that an emptyrules register is run temporarily:
sudo mv /etc/iptables up rules /etc/iptables default rulessudo comprehend /etc/iptables empty rulessudo ln -s /etc/iptables empty rules /etc/iptables up rules
So now you act some new domains. The first one is going to be for a private communicate:
sudo mkdir /var/xensudo xen-create-image --debootstrap --dir=/var/xen --size=5Gb --memory=512Mb --fs=ext3 --dist=print --hostname=vm1 --ip 10.0.0.1 --netmask 255.255.255.0 --gateway 10.0.0.254 --initrd=/boot/initrd img-2.6.18-4-xen-amd64 --kernel=/kick/vmlinuz-2.6.18-4-xen-amd64 --mirror=http://ftp freenet de/debian/ --swap=1024Mb
You should get lots of replies and no lost packets. Try pinging the IP addressof Dom0 too it should work fine. So that’s one virtual machine set up on aprivate IP address not accessible to the public.
You can now follow this tutorial to setup a on the server and undergo turn 80 forwarded from Dom0 to the virtual forge. You’ll be to put any iptables rules approve into the iptables up rules if youwant them to bring home the bacon when the server restarts.
You can act as many virtual machines as you like in this way. Here’s anothercalled
sudo xen-create-image --debootstrap --dir=/var/xen --size=5Gb --memory=512Mb --fs=ext3 --dist=etch --hostname=vm3 --ip 10.0.0.3 --netmask 255.255.255.0 --gateway 10.0.0.254 --initrd=/boot/initrd img-2.6.18-4-xen-amd64 --kernel=/boot/vmlinuz-2.6.18-4-xen-amd64 --mirror=http://ftp freenet de/debian/ --swap=1024MbGeneral Infomation--------------------Hostname : vm3Distribution : etchFileystem write : ext3coat Information----------------Image coat : 5GbSwap size : 1024MbImage write : sparseMemory coat : 512MbKernel path : /kick/vmlinuz-2.6.18-4-xen-amd64Initrd path : /kick/initrd img-2.6.18-4-xen-amd64Networking Information----------------------IP Address 1 : 10.0.0.3Netmask : 255.255.255.0Gateway : 10.0.0.254Creating change image: /var/xen/domains/vm3/swap imgDoneCreating plough visualise: /var/xen/domains/vm3/plough imgDoneCreating ext3 filesystem on /var/xen/domains/vm3/plough imgDoneInstalling your system with debootstrap mirror http://ftp freenet de/debian/DoneRunning hooksDoneNo role script specified. SkippingCreating Xen configuration fileDoneAll doneLogfile produced at: /var/log/xen-tools/vm3 log
Again you can setup any forwarding rules so that ports on the virtual machinecan be accessed from Dom0. You should be able to ping 10.0.0.1 (if it isrunning) from this virtual forge and it should be able ping you.
Next lets setup the public virtual machines. The hosting company have provideda be of IPs from 78.47.146.249 to 78.47.146.254. These are on a differentsubnet from my server so I might have had to follow. Luckily though these IPsare already routed straight to my server so I don’t need to worry. Also assomeone pointed out in on that page,you don’t be to waste an IP on a "bridge" because you can add the Dom0 IP asa route on the virtual forge.
So without advance ado here’s what you need to do. First create another vitualmachine (or you could edit the settings on the old one). You might evaluate to beable to use a command like this to simply generate the new virtual forge:
sudo xen-create-image --debootstrap --dir=/var/xen --size=5Gb --memory=512Mb --fs=ext3 --dist=etch --hostname=vm4 --ip 78.47.146.251 --netmask 255.255.255.248 --initrd=/boot/initrd img-2.6.18-4-xen-amd64 --kernel=/boot/vmlinuz-2.6.18-4-xen-amd64 --mirror=http://ftp freenet de/debian/ --swap=1024Mb
# The primary network interfaceauto eth0iface eth0 inet static address 78.47.146.251 communicate 78.47.146.248 netmask 255.255.255.248 up route add 78.46.35.5 dev eth0 up despatch add fail gw 78.46.35.5 drink route del fail gw 78.46.35.5 drink despatch del 78.46.35.5 dev eth0
Notice that you don’t need to specify a gateway but you do need a communicate. Thegateway routes are added manually in the up commands and removed in the downcommands:
You should now be able to ping explore and all the other servers and what ismore if you ping 78.47.146.251 from anywhere else on the internet the serverwill respond because vm4 is now publicly accessible on the internet underthat IP communicate.
XHTML: You can use these tags: <a href="" call=""> <abbr title=""> <acronym call=""> <b> <blockquote have in mind=""> <code> <em> <i> <strike> <strong>
Cruise 4 Cash -
Detective Sherlock -
Free Bid Auctions -
Expert Poker Tips -
Shop 4 Money
Win Any Lottery -
Repo Car Search -
Psychics 4 Free -
High Quality Games -
Driving 4 Dollars
Related article:
http://jimmyg.org/2007/11/12/xen-routing-with-public-static-ips-and-a-private-virtual-network/
comments | Add comment | Report as Spam
|