How we composed our KVM/VMware setup at Hetzner.de
In our setup (EQ4) we have a different IP for the dedicated rootserver (the EQ4) than our subnet.
As Hetzner routes subnets and doesn’t provide them ‘just’ available you can’t use bridged networking in a normal way.
The network at Hetzner is setup that ONLY the MAC-address (physical network adapter so to speak) of the EQ4 machine is allowed on the network.
Their solution, provided through their wiki, is to use NAT.
Our professionals in networking don’t like NAT, certainly not on dedicated hardware and there is an easy way around this.
We got our details from;
- The Hetzner wiki – wiki.hetzner.de
- This excellent blog-entry – blog.damn1337.de
- Our experience with ADSL routing stuff 🙂
- You are on a different subnet with your EQ4 than your host is
- or, same as above but you have multiple subnets (implicitly making your host differing from one of them)
- You run Linux (any, really) as your host operating system
- You use VMware Server to virtualize your environmentHelpfull
- We made this using debian as the host
- We have FreeBSD guests
- Installed VMware Server version 2Syntax
- We will use EQ4 host address 188.8.131.52
- We get subnet 184.108.40.206/28 routed to our box from Hetzner (14 usable ip)
Setup of the Host
- By defailt your /etc/network/interfaces (or similar) will look like
# device: eth0 auto eth0 iface eth0 inet static address 220.127.116.11 broadcast 18.104.22.168 netmask 255.255.255.224 gateway 22.214.171.124 # default route to access subnet up route add -net 126.96.36.199 netmask 255.255.255.224 gw 188.8.131.52 eth0
- We added the following (basically one route add per usable IP)
# Virtual subnet hosts routing up ip addr add 184.108.40.206/255.255.255.240 dev eth0 # Virtual hosts dedicated routing up route add -host 220.127.116.11 gw 18.104.22.168 up route add -host 22.214.171.124 gw 126.96.36.199 up route add -host 188.8.131.52 gw 184.108.40.206 up route add -host 220.127.116.11 gw 18.104.22.168 up route add -host 22.214.171.124 gw 126.96.36.199 up route add -host 188.8.131.52 gw 184.108.40.206 up route add -host 220.127.116.11 gw 18.104.22.168 up route add -host 22.214.171.124 gw 126.96.36.199 up route add -host 188.8.131.52 gw 184.108.40.206 up route add -host 220.127.116.11 gw 18.104.22.168 up route add -host 22.214.171.124 gw 126.96.36.199 up route add -host 188.8.131.52 gw 184.108.40.206 up route add -host 220.127.116.11 gw 18.104.22.168 up route add -host 22.214.171.124 gw 126.96.36.199
- Now just setup VMware to provide your virtual machines with BRIDGED networking
Setup of the Guest
- Install the VMware tools if you like (remember to install /usr/ports/misc/compat6x for FreeBSD 7 and up with VMware 2.0.2 or lower)
- For FreeBSD your almost there, just add these lines to your /etc/rc.conf
ifconfig_em0="188.8.131.52" # Static routes static_routes="direct default" route_direct="184.108.40.206 -iface em0" route_default="default 220.127.116.11"
- Remember/note that you have to add your EQ4 ip-address as the default route on your guest. Do not use the ‘Hetzner‘ provided gateway as that will block traffic
- Also remember to put a usefull /etc/pf.conf on your machine!
- (which goes for the linux base EQ4 as well!)