OVH Community, your new community space.

Adding IP to Windows VPS in Proxmox ??


Myatu
02-09-2009, 14:27
Quote Originally Posted by Nuend0
if anyone's a guide filling in the assumptions that i assume to be made in Myatu's guide on the firewall thing would b great
(i tried it and failed - added in the fallover ip's from best guess configuration to the host and coudn't get it to work - created a new vm and it grabbed an ip and gateway setings from another server once installed i have to assume since it had an ip & gateway well outside my specified ranges so i gave up going back to default config)
or if anyone can let me know how to just get 2 of the ip-fallovers working on my 2008 server which i would actually find preferable to minimise migration issues from current host
I'll have to expand that guide a bit more to make things a bit easier to understand

If you would like to keep your virtual server (Windows, etc) on its own private IP address, you do this as following:

You first need to setup the failover IP address on the host node (Proxmox). It's explained at http://help.ovh.co.uk/IpAlias but I'll repeat the relevant things here...

Once you have opened up the file /etc/network/interfaces in your editor, you will quickly notice how the network settings are in "sections". Ie,:

Code:
auto eth0
iface eth0 inet static
        address 91.11.22.33
        ... and more ...
A failover IP address will be assigned similarly. Start a new "section" (stanza) as following:

Code:
auto eth0:0
iface eth0:0 inet static
From now on, every time you add a new failover, the last number needs to be increased. For example, when you add a 2nd failover IP, you start your "section" with:

Code:
auto eth0:1
iface eth0:1 inet static
The configuration details for a failover IP address consists of only two lines:

Code:
address 
netmask 255.255.255.255
All you need to do is replace with the actual one.

Here's what the completed "section" looks like:

Code:
auto eth0:0
iface eth0:0 inet static
        address 91.11.22.44
        netmask 255.255.255.255
You save the file and exit the editor. Now you need to tell Linux / Proxmox to load this configuration. You could restart your server, but an quicker method is to type this command:

Code:
/etc/init.d/networking restart
Upon successful completion, your failover IP will now be available on the host node.

Going back to the guide, refer to the "Incoming Internet Traffic" section. Let's say your Windows virtual server was assigned the private IP 10.0.0.1 and it runs a web server on port 80, and the failover IP to be used is 91.11.22.44 (as in the above example).

You need to add this to the firewall/router rules. To do this, edit "/etc/shorewall/rules" and add the following line *before* the comment "# LAST LINE -- DO NOT REMOVE":

Code:
DNAT                    net     dmz:10.0.0.1          tcp     80       -    91.11.22.44
Now restart Shorewall with:

Code:
shorewall restart
And everything on port 80 arriving at your failover IP 91.11.22.44 gets forwarded to your virtual server.

Now, Windows need to be configured to actually use this private IP address of 10.0.0.1. If it picks up an IP and/or gateway automatically, then DHCP might have been enabled somewhere. The guide does work with DHCP (I'm using that) but explaining that takes a leap of faith if you're note familiar with Linux So let's stick to basics:

Refer to the "Microsoft Windows" section in the guide. It already gives you pointers on what needs to be changed. In effect, your main "Local Area Connection" needs to be manually assigned the IP address of 10.0.0.1 (for this example), the gateway needs to be 10.254.254.254 (if following the guide to the letter) and the subnet mask needs to be 255.0.0.0. For the DNS servers, you can specify any you'd like, ie., the OpenDNS servers, your own or those of OVH.

The only thing left standing at this point is to allow Windows to talk outward - so far we've only set it up for incoming traffic to port 80 in this example.

Because 10.x.x.x doesn't mean anything to the outside world (it really is a private IP address), Shorewall and Linux need to do a lot of magic tricks. Lucky for you, it only involves adding one line to the file "/etc/shorewall/masq":

Code:
eth0            10.0.0.0/8
And don't forget to restart Shorewall:

Code:
shorewall restart
Now, this is a very basic rule for outgoing traffic. Anything from a virtual server with a private IP address can use the Internet now, and it will use the default IP address (the main IP address assigned by OVH). The guide will explain how to tweak this.

Now what if you don't want to give it a private IP address? You say "I just want to use a failover IP address directly in Windows, clear and simple!"

In this case, skip the part of adding the failover IP address to the host node (Proxmox). For example, if you previously added a "section" like ...

Code:
auto eth0:0
iface eth0:0 inet static
        address  91.11.22.44
        netmask  255.255.255.255
.. and this is actually the failover IP you'd like to use in Windows, then you need to remove this section. Keep in mind that other virtual servers can no longer share this IP address (!!!) - it's ONLY used by one particular virtual server. (Remember to restart networking if you made any changes).

Now scroll up a bit where I explained about assigning it the IP 10.0.0.1 in Windows. Instead, you use the IP address of 94.11.22.44 (or whatever your *real* failover IP is), as the subnet you use 255.255.255.255 and as the gateway you use the same assigned by OVH.

Outgoing traffic is taken care of automatically, so you can skip the part of editing "/etc/shorewall/masq" (it doesn't need it -- although any other virtual servers you have configured might (!!!) ).

As for incoming traffic, the firewall still applies the rules (and so, it will not let anything in by default). The rules are also a bit different; notice how "DNAT" was used earlier in this example. You need to use "ACCEPT" instead. Here's that same rule for a virtual server with a failover IP directly assigned:

Code:
ACCEPT                    net     dmz:91.11.22.44          tcp     80
At first this all seems like a lot of abracadabra. But once it's up and running, you quickly forget it's there and will find making changes quite easy.

See, like a walk in the park! J/k - if you need some more help, feel free to contact me...

gigabit
02-09-2009, 00:19
The loopback adapter speed doesnt matter. And yes, i do know this for certain - I added an ip failover to my windows box, it was only 10mbit, but speeds for that IP were still gigabit and the network graph in taskman showed 0% for the loopback device. Its only for making windows respond to the IPs, nothing more.

Nuend0
02-09-2009, 00:00
Quote Originally Posted by derchris
It is explained in the Wiki how to add IP aliases:

http://help.ovh.co.uk/IpAlias#link10
just tried this on 2008 STD x64 and one major problem is the loopback adapter is only 10mbit

i've tried adding the ip's to proxmox & windows by themselves but cannot work out how to get windows to get on the net

the firewall thing looks good to me but bit of a linux n00b so might take me a bit to configure

just got this EG-09 Best Of and trying to get it config'd and everything migrated from current host asap to get it canceled

if anyone's a guide filling in the assumptions that i assume to be made in Myatu's guide on the firewall thing would b great
(i tried it and failed - added in the fallover ip's from best guess configuration to the host and coudn't get it to work - created a new vm and it grabbed an ip and gateway setings from another server once installed i have to assume since it had an ip & gateway well outside my specified ranges so i gave up going back to default config)
or if anyone can let me know how to just get 2 of the ip-fallovers working on my 2008 server which i would actually find preferable to minimise migration issues from current host

cheers in advance

ovhfreak
17-08-2009, 17:23
Quote Originally Posted by derchris
It is explained in the Wiki how to add IP aliases:

http://help.ovh.co.uk/IpAlias#link10
I already tried all these steps but it still shows IP Conflict ERROR saying that the IP address is already use on network. I checked and found that that IP address is not used by any other VM.

Please help ??
Also, What Should i write in Default Gateway option ??

Myatu
16-08-2009, 19:55
Make sure you do not assign the failover IP to the host node (Proxmox) *and* Windows. It's either-or.

I'm using a firewall/router between OVH's network and the VMs. See http://www.ovhwiki.com/index.php/Fir...r_with_Proxmox. So in my case, the failover IP (ie., 91.1.2.3) gets assigned to Proxmox, and the firewall/router delegates it to whichever VM (ie, Windows running on 10.1.2.3). Added benefit, other than a firewall, is that you can use the same IP on several VMs as long they use a different port...

derchris
16-08-2009, 14:40
It is explained in the Wiki how to add IP aliases:

http://help.ovh.co.uk/IpAlias#link10

ovhfreak
16-08-2009, 08:26
Hi, I have a EGBestOF server installed with Proxmox VE 1.3

I created a Virtual Machine of Windows XP on it, everything went fine ...

But I dont know how to setup an IP address and Networking to this V. Machine

I tried this one line command
C:\Windows\System32\netsh.exe int ip set address "Local Area Connection" static xxx.xxx.xxx.xxx 255.255.255.255 xxx.xxx.xxx.xxx 1

where xxx.xxx.xxx.xxx is the Failover IP I want to add.

It doesn't allow adding my failover ip with this subnet mask. then i changed this to 255.255.255.0

i.e. the command i used was :
C:\Windows\System32\netsh.exe int ip set address "Local Area Connection" static xxx.xxx.xxx.xxx 255.255.255.0 xxx.xxx.xxx.xxx 1

After this command, I get a warning about IP conflict and it says "The Static IP you configured is already in use on network" !!

Any help in this regard will be appreciable !