f

setting route Debian lenny 5.0

1. Instalasi Operating System Linux Debian
2. setting ip address pada debian dengan mengetikkan perintah:
#nano /etc/network/interface
auto eth0
allow-hotplug eth0
iface eth0 inet static
address 172.26.78.19
netmask 255.255.255.224
network 172.26.78.0
broadcast 172.26.78.31
gateway 172.26.78.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 124.81.116.2

auto eth1
iface eth1 inet static
address 192.168.10.1
netmask 255.255.255.0
broadcast 192.168.10.255


3. kemudian setting buat iptablesnya dengan mengetikkan perintah dibawah ini
#iptables -t nat -A POSTROUTING -o eth0 -s 192.168.10.0/24 -j MASQUERADE (belum ada squid)
#iptables -t nat -A POSTROUTING -o eth0 -s 192.168.10.0/24 -j MASQUERADE
Setelah itu simpan dengan mengetikkan perintah:
#iptables-save > /etc/iptables.conf
#echo “iptables-restore < /etc/iptables.conf” >> /etc/network/if-up.d/iptables
#chmod 755 /etc/network/if-up.d/iptables
4. Setting ipforward dengan mengetikkan perintah:
#nano /etc/sysctl.conf

setelah masuk hilangkan tanda # pada tulisan dibawah ini:
net.ipv4.conf.default.rp_filter=1
net.ipv4.ip_forward =1
net.ipv4.conf.default.forwarding=1
net.ipv6.conf.default.forwarding=1

setelah itu tekan ctrl+o untuk menyimpannya

kalau sudah tersimpan terus ketikkan perintah dibawah ini:

#sysctl -p /etc/sysctl.conf -A (untuk merestart ip forward)
#sysctl -A|grep forward

0 komentar: