settingan NAT , DHCP, n Firewall (iptable) di ubuntu 7.10 server..
Setting EtherNet Card n NAT
1. edit file di /etc/network/interface
# nano /etc/network/interface
contoh isinya
#————————————-
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.16.200
netmask 255.255.255.0
network 1192.168.16.0
broadcast 192.168.16.255
gateway 192.168.16.254
nameserver 192.168.16.253
auto eth1
iface eth1 inet static
address 10.10.10.200
netmask 255.255.255.0
network 10.10.10.0
broadcast 10.10.10.255
#————————————-
2. Enable IP Fordwarding
#echo 1 > /proc/sys/net/ipv4/ip_forward
3. Routing Network
# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
4. Restart The Network
# /etc/init.d/networking restart
buat dhcp
1. install paket dhcp
# apt-get install dhcp3-server
2. konfigurasi file /etc/dhcp3/dhcpd.conf
# nano /etc/dhcp3/dhcpd.conf
3. tambahkan baris-baris berikut
#————————————-
subnet 10.10.10.0 netmask 255.255.255.0 {
range 10.10.10.50 10.10.10.199;
option routers 10.10.10.200;
option domain-name-servers 192.168.16.253;
}
#————————————-
4. restart daemon dhcpd
# /etc/init.d/dhcp3-server restart
buat Aturan IpTables (firewall)
# iptables -t nat -A PREROUTING -s 10.10.10.0/24 -d 192.168.3.5 -j ACCEPT
# iptables -t nat -A PREROUTING -s 10.10.10.0/24 -d 10.10.10.200 -j ACCEPT
# iptables -t nat -A PREROUTING -s 10.10.10.0/24 -d 192.168.16.200 -j ACCEPT
# iptables -t nat -A PREROUTING -s 10.10.10.0/24 -d 192.168.16.254 -j ACCEPT
# iptables -t nat -A PREROUTING -s 10.10.10.0/24 -d 192.168.16.253 -j ACCEPT
# iptables -t nat -A PREROUTING -s 10.10.10.0/24 -d 10.10.10.253 -j ACCEPT
# iptables -t nat -A PREROUTING -s 10.10.10.0/24 -j DROP
buat matiin internet na
# iptables -t nat -I PREROUTING -s 10.10.10.0/24 -d 192.168.3.5 -j DROP
EmoticonEmoticon