: 15 marca 2008, 15:09
no wlasnie, to ma byc router, nie ma monitora i klawiatury, podlanczam sie zdalnie przez eh0(lan) i chce pod eth1 podpiac net ale nie dziala pobieranie adresu przez dhcp
Polski portal użytkowników dystrybucji Debian GNU/Linux, dyskusje, artykuły, nowości, blog, porady, pomoc.
https://www.debian.pl/
Kod: Zaznacz cały
auto eth0
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
# dns-* options are implemented by the resolvconf package, if installed
#dns-nameservers 192.168.1.1
#dns-search tmspeed.no-ip.com
auto eth1
iface eth1 inet dhcp
dwie ostatnie linijki nie pomagają ,#!/bin/bash
# wlaczenie w kernelu forwardowania
echo 1 > /proc/sys/net/ipv4/ip_forward
# czyszczenie starych regul
iptables -F
iptables -X
iptables -t nat -X
iptables -t nat -F
# ustawienie polityki dzialania
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
# zezwolenie nna laczenie sie z naszym zewnetrznym ip po ssh
iptables -A INPUT -i lo -j ACCEPT
iptables -A FORWARD -o lo -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 67 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
# polaczenia nawiazane
iptables -A INPUT -j ACCEPT -m state --state ESTABLISHED,RELATED
iptables -A FORWARD -j ACCEPT -m state --state ESTABLISHED,RELATED
iptables -A OUTPUT -j ACCEPT -m state --state ESTABLISHED,RELATED
# udostepniaie internetu w sieci lokalnej
iptables -t nat -A POSTROUTING -s 192.168.1.2 -j MASQUERADE
iptables -A FORWARD -s 192.168.1.2 -j ACCEPT
iptables -t nat -A POSTROUTING -s 192.168.1.3 -j MASQUERADE
iptables -A FORWARD -s 192.168.1.3 -j ACCEPT
iptables -t nat -A POSTROUTING -s 192.168.1.4 -j MASQUERADE
iptables -A FORWARD -s 192.168.1.4 -j ACCEPT
iptables -t nat -A POSTROUTING -s 192.168.1.5 -j MASQUERADE
iptables -A FORWARD -s 192.168.1.5 -j ACCEPT
#iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -j MASQUERADE
#iptables -A FORWARD -s 192.168.1.0/24 -j ACCEPT
Kod: Zaznacz cały
apt-get install dnsmasq