Home Tutorial Setting Proxmox VE Single IP Public menggunakan metode NAT dan Port Forwading
formats

Setting Proxmox VE Single IP Public menggunakan metode NAT dan Port Forwading

Published on January 18, 2016, by in Tutorial.

Kali ini kita konfigurasi server proxmox yang memiliki 1 ip publik, akan tetapi Virtual Private Server KVM dan OpenVZ di server proxmox bisa mendapatkan internet menggunakan ip private dengan metoda NAT dan bisa remote VPS tersebut dari luar menggunakan port forwading.

Konfigurasi /etc/network/interfaces seperti ini :

Source /etc/network/interfaces.d/*

# The loopback network interfaces

auto lo

iface lo inet loopback

# Primary network interfaces

allo-hotplug eth0

iface eth0 inet static

address 113.242.107.110

netmask 255.255.255.248

network 113.242.107.108

broadcast 113.242.107.111

gateway 113.242.107.109

# dns server

dns-nameservers 113.242.107.109 8.8.8.8 8.8.4.4

dns-search server.com

# ip lokal untuk vps

auto vmbr0

iface vmbr0 inet static

address 10.10.10.1

netmask 255.255.255.0

bridge_ports none

bridge_stp off

bridge_fd 0

post-up echo 1 > /proc/sys/net/ipv4/ip_forward

# ngasih internet ke server vps

post-up iptables -t nat -A POSTROUTING -s ‘10.10.10.0/24’ -o eth0 -i MASQUERADE

post-down iptables -t nat -D POSTROUTING -s ‘10.10.10.0/24’ -o eth0 -i MASQUERADE

# port forwading

post-up iptables -t nat -A PREROUTING -i eth0 -p tcp –dport 222 -j DNAT –to 10.10.10.2:22

post-down iptables -t nat -D PREROUTING -i eth0 -p tcp –dport 222 -j DNAT –to 10.10.10.2:22

Simpan konfigurasi diatas, kemudian restart server kita. Demikian semoga bermanfaat.

Leave a Reply

Your email address will not be published. Required fields are marked *