Nie jesteś zalogowany.
Jeśli nie posiadasz konta, zarejestruj je już teraz! Pozwoli Ci ono w pełni korzystać z naszego serwisu. Spamerom dziękujemy!
Prosimy o pomoc dla małej Julki — przekaż 1% podatku na Fundacji Dzieciom zdazyć z Pomocą.
Więcej informacji na dug.net.pl/pomagamy/.

Członek DUG


O co chodzi?
Mój komp treningowy :) na którym mam postawiony router pomiędzy sieciami 10.0.0.0 i 192.168.1.0 ma IP eth0 10.0.0.1 oraz ath0 192.168.1.1. Dopóki nie włączam tego firewalla (kod poniżej) wszystko jest cacy: mogę przeglądać spokojnie otoczenie sieciowe 10.0.0.0 windowsów i grupa robocza z nazwami kompów ładnie mi się zgłasza.
Po włączeniu jest lipa. Co trzeba jeszcze dodać żeby można było normalnie przeglądać zasoby?
Mój firewall wygląda tak:
#!/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 OUTPUT -o lo -j ACCEPT iptables -A FORWARD -o lo -j ACCEPT ############################## SAMBA ############################# iptables -A INPUT -p tcp --dport 137 -s 10.0.0.0/24 -m state --state NEW -j ACCEPT iptables -A INPUT -p udp --dport 137 -s 10.0.0.0/24 -m state --state NEW -j ACCEPT iptables -A INPUT -p tcp --dport 138 -s 10.0.0.0/24 -m state --state NEW -j ACCEPT iptables -A INPUT -p udp --dport 138 -s 10.0.0.0/24 -m state --state NEW -j ACCEPT iptables -A INPUT -p tcp --dport 139 -s 10.0.0.0/24 -m state --state NEW -j ACCEPT iptables -A INPUT -p udp --dport 139 -s 10.0.0.0/24 -m state --state NEW -j ACCEPT ################################## ssh ########################## iptables -A INPUT -s 0/0 -d 10.0.0.1 -p tcp --dport 22 -j ACCEPT iptables -A OUTPUT -s 0/0 -d 10.0.0.1 -p tcp --dport 22 -j ACCEPT iptables -A INPUT -s 0/0 -d 10.0.0.1 -p udp --dport 22 -j ACCEPT iptables -A OUTPUT -s 0/0 -d 10.0.0.1 -p udp --dport 22 -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.0/24 -j MASQUERADE iptables -A FORWARD -s 192.168.1.0/24 -j ACCEPT
Offline

Użytkownik


wydaje mi sie ze ten firewall dziala na polityce..
najpierw wszystko zablokujemy a pozniej bedziemy otwierac poszczegolne furtki :)
Offline


były zielony_83 :)
otwórz jeszcze port 445
Offline

Członek DUG


Dopisałem to:
iptables -A INPUT -p tcp --dport 445 -s 10.0.0.0/24 -m state --state NEW -j ACCEPT iptables -A INPUT -p udp --dport 445 -s 10.0.0.0/24 -m state --state NEW -j ACCEPT
Teraz w otoczeniu sieciowym widze tylko siebie. Na kompach z XP jestem widziany normalnie.
Jak u siebie wpisze np. smb://10.0.0.2/ to wchodze w sasoby tamtego kompa, natomiast po nazwie NIE.
Offline

Członek DUG


Na twoim miejscu to bym nie liczyl na otoczenie sieciowe windy bo to jest bardzo zawodna sprawa. Jak chcesz zeby wszystkie komputery w sieci byly widoczne to skonfiguruj sobie dns
Offline




matka przelozona
iptables -A FORWARD -s 10.0.0.0/24 -d 192.168.1.0 -j ACCEPT iptables -A INPUT -s 10.0.0.0/24 -d 192.168.1.0 -j ACCEPT iptables -A FORWARD -d 10.0.0.0/24 -s 192.168.1.0 -j ACCEPT iptables -A INPUT -d 10.0.0.0/24 -s 192.168.1.0 -j ACCEPT
Co do otoczenia sieciwego to sprawa jest taka ze jak sie postawi sambe i zalaczy w niej seerver wins i ustawi sie go na terminalach to wiekszego problemu niema :]
Offline

Członek DUG


Niestety BiExi po dodaniu tamtego wywala:
Bad argument `192.168.1.0'
To się tyczyło mojego kompa na którym mam postawiony teraz router.
Teraz w otoczeniu sieciowym widze tylko siebie. Na kompach z XP jestem widziany normalnie.
Jak u siebie wpisze np. smb://10.0.0.2/ to wchodze w sasoby tamtego kompa, natomiast po nazwie NIE.
Próbowałem już dużo różnych wpisów, ale po włączeniu firewall-a wszyscy mi giną :(
PS. Jest jakiś edytor pod XP do pisania skryptów dla linux? Chodzi o znak końca linii.
Offline



Członek DUG
PS. Jest jakiś edytor pod XP do pisania skryptów dla linux? Chodzi o znak końca linii.
Może gvim ;)
ftp://ftp.vim.org/pub/vim/pc/gvim70.exe
Offline

Członek DUG


Nie moge sobie z tym poradzic :(
W XP-kach jestem normalnie widziany, natomiast Ja ich po netbios nie widze.
Pingi po IP sa odbijane, po nazwach juz nie :(
Samba jest napewno dobrze skonfigurowana, bo dopoki nie uruchomie skryptu firewall-a, wszystko dziala super.
Moj obecny skrypt:
#!/bin/bash ##################### zmienne srodowiskowe ####################### # IP sieci wewnetrznej IPSW=10.0.0.0/24 # IP sieci zewnetrznej IPSZ=192.168.1.0/24 # Moje IP wewnetrzne IPMW=10.0.0.1 ############## 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 na pelny ruch na interfejsie lo ## iptables -A INPUT -i lo -j ACCEPT iptables -A OUTPUT -o lo -j ACCEPT iptables -A FORWARD -o lo -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 ############################### DNS ############################## iptables -A INPUT -p tcp --dport 53 -j ACCEPT iptables -A INPUT -p udp --dport 53 -j ACCEPT ############################## http i https ###################### iptables -A INPUT -p tcp --dport 80 -j ACCEPT iptables -A INPUT -p udp --dport 80 -j ACCEPT iptables -A INPUT -p tcp --dport 443 -j ACCEPT iptables -A INPUT -p udp --dport 443 -j ACCEPT ######################## smtp oraz pop3 - oba z ssl ############## iptables -A INPUT -p tcp --dport 25 -j ACCEPT iptables -A INPUT -p udp --dport 25 -j ACCEPT iptables -A INPUT -p tcp --dport 110 -j ACCEPT iptables -A INPUT -p udp --dport 110 -j ACCEPT iptables -A INPUT -p tcp --dport 465 -j ACCEPT iptables -A INPUT -p udp --dport 465 -j ACCEPT iptables -A INPUT -p tcp --dport 995 -j ACCEPT iptables -A INPUT -p udp --dport 995 -j ACCEPT ################################## ssh ########################### iptables -A INPUT -s 0/0 -d $IPMW -p tcp --dport 22 -j ACCEPT iptables -A OUTPUT -s 0/0 -d $IPMW -p tcp --dport 22 -j ACCEPT iptables -A INPUT -s 0/0 -d $IPMW -p udp --dport 22 -j ACCEPT iptables -A OUTPUT -s 0/0 -d $IPMW -p udp --dport 22 -j ACCEPT ############################## SAMBA ############################# #iptables -I INPUT -i $IPSW -p udp --dport 137:139 -j ACCEPT #iptables -I INPUT -i $IPSW -p tcp --dport 137:139 -j ACCEPT #lub samba iptables -A INPUT -p tcp --dport 137 -s $IPSW -m state --state NEW -j ACCEPT iptables -A INPUT -p udp --dport 137 -s $IPSW -m state --state NEW -j ACCEPT iptables -A INPUT -p tcp --dport 138 -s $IPSW -m state --state NEW -j ACCEPT iptables -A INPUT -p udp --dport 138 -s $IPSW -m state --state NEW -j ACCEPT iptables -A INPUT -p tcp --dport 139 -s $IPSW -m state --state NEW -j ACCEPT iptables -A INPUT -p udp --dport 139 -s $IPSW -m state --state NEW -j ACCEPT ############################ otoczenie sieciowe dwoch sieci ############## #iptables -A FORWARD -s $IPSW-d $IPSZ -j ACCEPT #iptables -A INPUT -s $IPSW -d $IPSZ -j ACCEPT #iptables -A FORWARD -d $IPSW -s $IPSZ -j ACCEPT #iptables -A INPUT -d $IPSW -s $IPSZ -j ACCEPT #################################### osolek ####################### iptables -A INPUT -p tcp --dport 4663 -j ACCEPT iptables -A INPUT -p udp --dport 4673 -j ACCEPT ################# udostepniaie internetu w sieci lokalnej########## iptables -t nat -A POSTROUTING -s $IPSZ -j MASQUERADE iptables -A FORWARD -s $IPSZ -j ACCEPT
Offline



Członek DUG




iptables -F
iptables -F INPUT
iptables -P INPUT DROP
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -s 192.168.1.0/24 -p udp --dport 137 -m state --state NEW -j ACCEPT
iptables -A INPUT -s 192.168.1.0/24 -p udp --dport 138 -m state --state NEW -j ACCEPT
iptables -A INPUT -s 192.168.1.0/24 -p tcp --dport 139 -m state --state NEW -j ACCEPT
iptables -A INPUT -s 192.168.1.0/24 -p tcp --dport 445 -m state --state NEW -j ACCEPT
iptables -A INPUT -s 192.168.2.0/24 -p udp --dport 137 -m state --state NEW -j ACCEPT
iptables -A INPUT -s 192.168.2.0/24 -p udp --dport 138 -m state --state NEW -j ACCEPT
iptables -A INPUT -s 192.168.2.0/24 -p tcp --dport 139 -m state --state NEW -j ACCEPT
iptables -A INPUT -s 192.168.2.0/24 -p tcp --dport 445 -m state --state NEW -j ACCEPT
I ma działać
Offline




matka przelozona

Członek DUG


BiExi: Probowalem ale ciagle to samo :(
guzzi: I dziala :)
PS. Mam superkarambe z zainstalowanym monitorem sieci. O co chodzi z tym znikaniem transferu co 1s. tzn jest np. 22KB/s, 00KB/s, jest np 90KB/s, 00KB/s, 70KB/s, 00KB/s i tak cały czas zarowno na UL jak i DL. Wykres dosyc dziwnie wyglada tzn. /////////
Offline