~# nano /etc/network/interfaces
auto lo eth0 eth1
iface lo inet loopback
iface eth0 inet static
address 192.168.1.15
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.254
gateway 192.168.1.1
iface eth1 inet static
address 172.10.15.1
netmask 255.255.255.224
network 172.10.15.0
broadcast 172.10.15.32
setelah itu
disimpan (CTRL+O <enter>, CTRL+X)
~# apt-get install iptables
~# nano /etc/sysctl.conf
cari teks
berikut
#net.ipv4.ip_forward=1
Lalu lepas
tanda pagar (#) untuk diaktifkan:
net.ipv4.ip_forward=1
setelah itu
disimpan (CTRL+O <enter>, CTRL+X)
~# nano /etc/rc.local
Masukkan
perintah berikut di atas teks “Exit 0”
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables –t nat –A POSTROUTING –o eth0 –j MASQUERADE
exit 0
setelah itu
disimpan (CTRL+O <enter>, CTRL+X)
~# service networking
restart
No comments:
Post a Comment