I want to host some VMs (Debians) on a online dedicated server (Debian 8 without graphical interface).
I have public IP available for each one and I want them accessible by their public IP
The host server (1&1 provider) only accept NAT mode for virtualisation (if Bridge mode -> MAC spoofing -> host blocked)
My provider says I can access guest on their public IP by :
activate host IP forwarding:
Code: Select all
root@Host:~# sudo sh -c "echo 1 /proc/sys/net/ipv4/ip forward"Code: Select all
root@Host:~# route add -host 217.160.167.xxx dev virbr0Code: Select all
root@Host:~# iptables -I FORWARD 1 -t filter -d 217.160.167.xxx/32 -o virbr0 -j ACCEPT
root@Host:~# iptables -I FORWARD 1 -t filter -s 217.160.167.xxx/32 -i virbr0 -j ACCEPT
Is there a solution to create this route and next the iptables ?
I know that I can use port forwarding with NAT mode but I want each VM be accessible by their own IP because same service (same ports) on each VMs
Thanks a lot and sorry for my english ...