removido
(usa Nenhuma)
Enviado em 15/02/2011 - 03:54h
---------------- dhcpd.conf -----------------
# dhcpd.conf
#
# Configuration file for ISC dhcpd (see 'man dhcpd.conf')
#
ddns-update-style none;
default-lease-time 2400;
max-lease-time 7200;
authoritative;
subnet 192.168.2.0 netmask 255.255.255.0 {
range 192.168.2.2 192.168.2.254;
option broadcast-address 192.168.2.255;
option routers 192.168.2.1;
option domain-name-servers 200.189.80.43,200.188.80.5;
}
subnet 192.168.3.0 netmask 255.255.255.0 {
range 192.168.3.2 192.168.3.254;
option broadcast-address 192.168.3.255;
option routers 192.168.3.1;
option domain-name-servers 200.189.80.43,200.188.80.5;
}
host slack-dhcp2 { hardware ethernet 08:00:27:f1:77:15; fixed-address 192.168.2.2; }
host FreeBSD { hardware ethernet 08:00:27:7b:ea:40; fixed-address 192.168.2.10; }
#####################################################################################
---------------- rc.dhcpd -----------------
#!/bin/sh
INTERFACE="eth1 eth2"
# limpa
echo '' > /var/state/dhcp/dhcpd.leases
case $1 in
start|START)
dhcpd -cf /etc/dhcpd.conf $INTERFACE
exit 1
;;
stop|STOP)
killall dhcpd
exit 1
;;
restart|RESTART)
killall dhcpd
dhcpd -cf /etc/dhcpd.conf $INTERFACE
exit 1
;;
esac
dhcpd -cf /etc/dhcpd.conf $INTERFACE
#####################################################################################
---------------- rc.firewall -----------------
#!/bin/sh
IPTABLES=/usr/sbin/iptables
REDE=192.168.0.0/16
STOP() {
# Limpando as regras em memoria
$IPTABLES -F -t filter
$IPTABLES -F -t mangle
$IPTABLES -F -t nat
$IPTABLES -X -t filter
$IPTABLES -X -t mangle
$IPTABLES -X -t nat
$IPTABLES -Z -t filter
$IPTABLES -Z -t mangle
$IPTABLES -Z -t nat
}
START() {
# NAT
$IPTABLES -t nat -A POSTROUTING -s $REDE -o eth0 -j MASQUERADE
}
case $1 in
start|START)
START
exit 1
;;
stop|STOP)
STOP
exit 1
;;
restart|RESTART)
STOP
START
exit 1
;;
esac