Cara Konfigurasi IP Address, DNS Client dan NAT di Ubuntu Server
Setting ip interface
1 | sudo nano /etc/network/interfaces |
Default konfigurasi eth0 menggunakan IP DHCP :
1 2 | auto eth0 iface eth0 inet dhcp |
Rubah menjadi :
1 2 3 4 5 6 | auto eth0 iface eth0 inet static address 192.168.1.10 netmask 255.255.255.0 gateway 192.168.1.1 dns-nameservers 8.8.8.8 8.8.4.4 #Setting DNS Client Ubuntu 12.04 |
1 2 3 4 | auto eth1 iface eth1 inet static address 10.10.10.1 netmask 255.255.255.0 |
Konfigurasi DNS Client Ubuntu 11.10 ke bawah :
1 | sudo nano /etc/resolv.conf |
Tambahkan :
1 2 | nameserver 8.8.8.8 nameserver 8.8.4.4 |
Aktfikan IP Forward
1 | sudo nano /etc/sysctl.conf |
Hapus # pada baris kode
1 | net.ipv4.ip_forward=1 |
Set IP TABLE, agar perintah iptables dijalankan pada saat booting
1 | $ sudo nano /etc/rc.local |
Tambahkan sebelum bari exit 0
1 | iptables –t nat –A POSTROUTING –o eth0 –j MASQUERADE |
referensi :
kurniawanadam.wordpress.com
howtoforge.com