Enviado em 19/04/2013 - 16:16h
etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
auto eth1
iface eth1 inet dhcp
/etc/dhcp/dhcpd.conf
ddns-update-style none;
default-lease-time 600;
max-lease-time 7200;
authoritative;
log-facility local7;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.254;
option routers 192.168.1.1;
option domain-name-servers 200.204.0.10,200.204.0.138;
option broadcast-address 192.168.1.255;
}
/etc/rc.local
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -d 0/0 -j MASQUERADE
modprobe iptable_nat
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
/etc/default/isc-dhcp-server
INTERFACES="eth0"
IP do roteador é o 192.168.0.1 esta conectado a eth0 e o dhcp esta habilitado.
auto eth0
iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
auto eth1
iface eth1 inet dhcp
/etc/dhcp/dhcpd.conf
ddns-update-style none;
default-lease-time 600;
max-lease-time 7200;
authoritative;
log-facility local7;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.254;
option routers 192.168.1.1;
option domain-name-servers 200.204.0.10,200.204.0.138;
option broadcast-address 192.168.1.255;
}
/etc/rc.local
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -d 0/0 -j MASQUERADE
modprobe iptable_nat
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
/etc/default/isc-dhcp-server
INTERFACES="eth0"
IP do roteador é o 192.168.0.1 esta conectado a eth0 e o dhcp esta habilitado.