Proxmox v2.0 on Hetzner Working Setup

  • Thread starter Thread starter blackfox
  • Start date Start date
B

blackfox

Guest
I've been searching for a setup guide for Proxmox on Hetzner, and I've been looking through tons of wiki's and forums, I ended up with more problems than I should have had in the first place.
Therefore this setup guide.

I got 4 SINGLE IP's, NOT an additional SUBNET, which may require a slightly different setup.

The initial setup on Hetzner is pretty straightforward: Activate a Rescue System than Reboot and start installimage.

Scroll down till you see Virtualization/Proxmox

Select if you want Software RAID=1 or not, I selected not RAID=0

For LVM The settings for vg0-root and Swap are already provided for, you still have to manually select vg0-data and point it to /var/lib/vz and set it to all.

If you selected RAID=1 the installation is ready. If you didn't, you still need to set the second HD later after the installation is finished.


Once the installation is finished you can set your 2nd HD or wait with it till everything works.

Edit your settings:

1. /etc/network/interfaces

Take note of the address, broadcast, netmask, and gateway settings you need to reuse then.

# network interface settings
auto lo
iface lo inet loopback
#
auto vmbr0
iface vmbr0 inet static
address YOUR.IP.ADDR.ESS
broadcast YOUR.BRO.ADC.AST
netmask YOUR.NET.MA.SK
gateway YOUR.GA.TE.WAY
bridge_ports eth0
bridge_stp off
bridge_fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward

Or use the default settings and change eth0 in vmbr0 and add:

bridge_ports eth0
bridge_stp off
bridge_fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward

As you can see these settings are the standard Proxmox settings nothing exotic here.

2. /etc/sysctl.conf:


net.ipv4.ip_forward=1
net.ipv4.conf.default.proxy_arp = 0
net.ipv4.conf.all.rp_filter=1
net.ipv4.icmp_echo_ignore_broadcasts=1
kernel.sysrq = 1
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0

You can copy and paste these settings

And that's all settings you need.

Do a #service networking restart at least 2 times and check for errors and/or do a reboot



For OpenVZ containers:


Do NOT ENABLE the virtual MAC with Hetzner for your selected IP Use venet only and fill in that IP, and that's it.



For KVM:

ENABLE the virtual MAC with Hetzner for your selected IP and use that MAC it in the network settings.


Remember your 2nd HD and that's it.


If somebody has selected a IP subnet and a working solution please add it.
 
Last edited by a moderator:
Hi
I have also done similare thing on Hetzner.

I install teh default Proxmox with PVe 2.x and it was a breeze..

But I am struggelign with one thing.

I dont understand how I should set up a virtual machine or Cluser that uses its own ip. So I can access this computer with this other public ip.

I have tried all things that I can imaging but I cant get it to work.
Could you please explain it for me hwo I am doing this? If it is needed done in the Command line the commands or if it cna be doen form the PVE2.x please a few screenshots.

Thanks in advanced.

Ole
 
You have the public addresses on eth0 (all public addresses)
and create a simple vmbr0 withouth interfaces associated to it

like this

auto eth0
iface eth0 inet static
address myplublicaddress
netmask mynetmask
gateway mygateway
up "ip address add mysecondaddress dev eth0 ||true"
up "ip address add mythirthaddress dev eth0 ||true"
up "ip address add myfourthaddress dev eth0 ||true"



auto vmbr0
iface vmbr0 inet static
address 192.168.255.254
netmask 255.255.255.0
network 192.168.255.0
bridge_ports none
bridge_stp off
bridge_fd 0

and assign to all virtual machines an address in the
192.168.255.0 network
with gateway 192.168.255.254

masqueradde all traffic coming from this net versus internet

iptables -t nat -I POSTROUTING -s 192.168.255.0/24 -o eth0 -j SNAT --to-source mypublicaddress
and dnat the services associated to the real IP

iptables -t nat -I PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.168.255.1:80
and so on

i prefer to use shorewall

but you can do what you need with whatever iptables you want

Diaolin
 
HI thanks you for the info..
So if I get you right I edit the network file and add my ip as you has shown..and when theese things are done ai reboot the service so it is enabled..
And as you ay ai must use the mask and gateway for all wm I want to use a seperate uniqe ip.

But I felt a bit off. when you start on lower section masqueradde all trafick.. This is not clear. for me. IS this a nessesary step or a nice to have step?

If I have a publick adress 1.1.1.1 what would the command line be then..

THanks for help so faar.

Ole
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!