INTERNET GATEWAY
· Setting eth0 dan eth1 di dalam file inet1.conf
pico /etc/rc.d/rc.inet1.conf
# Config information for eth0:
IPADDR[0]=""
NETMASK[0]=""
USE_DHCP[0]="yes"
DHCP_HOSTNAME[0]=""
NETMASK[0]=""
USE_DHCP[0]="yes"
DHCP_HOSTNAME[0]=""
DHCP_KEEPRESOLV[0]=”yes” <---- bila ingin menjadikan resolv.conf static
# Config information for eth1:
IPADDR[1]=”isikan ip addres untuk jaringan local”
NETMASK[1]=”255.255.255.0”
USE_DHCP[1]=”no”
DHCP_HOSTNAME[1]=””
· Kemudian save
“Ctrl+x”, “Y”, “enter”
· Restart inet1.conf
/etc/rc.d/rc.inet1 restart
· Setting ip_forward menjadi “1”
echo “1” > /proc/sys/net/ipv4/ip_forward
· Setting iptables agar client dapat terhubung ke internet
iptables –t nat –A POSTROUTING –s netid jaringan local/netmask –d 0/0 –j MASQUERADE
· Bila ingin internet gateway dapat jalan tanpa harus login server, masukkan beberapa settingan ke dalam “rc.local”
pico /etc/rc.d/rc.local
ifconfig eth0 up
ifconfig eth1 up
iptables –A INPUT –i eth1 –j ACCEPT
iptables –A INPUT –i eth0 –j ACCEPT
iptables –A FORWARD –i eth0 –o eth1 –j ACCEPT
iptables –A FORWARD –i eth1 –o eth0 –j ACCEPT
iptables –A OUTPUT –o eth0 –j ACCEPT
iptables –A OUTPUT –o eth1 –j ACCEPT
iptables –t nat –A POSTROUTING –s netid jaringan local/netmask –d 0/0 –j MASQUERADE
· Kemudian restart “rc.local”
/etc/rc.d/rc.local restart
· Kemudian konfigurasi client…
No comments:
Post a Comment