Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
firewall
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Scandinavian
View previous topic :: View next topic  
Author Message
andybrandorff
n00b
n00b


Joined: 03 Aug 2004
Posts: 57
Location: denmark

PostPosted: Tue Feb 22, 2005 1:45 am    Post subject: firewall Reply with quote

hej jeg kan ikke lige fatte hvor jeg skal gemme min firewll fil.
har fulgt http://gentoo-wiki.com/HOWTO_setup_a_home-server#Configuring_masquerading_and_basic_firewall
på fordhånd tak
Back to top
View user's profile Send private message
andybrandorff
n00b
n00b


Joined: 03 Aug 2004
Posts: 57
Location: denmark

PostPosted: Tue Feb 22, 2005 10:28 am    Post subject: Reply with quote

jeg har prøvet at lave en fil kalet firewall
Code:
nano w /etc/init.d/firewall


og skrevet filen
Code:
#!/bin/sh
# Set location of iptables
IPTABLES=/sbin/iptables

iptables -F
iptables -t nat -F


#for at bruge dhcp
iptables -F; iptables -t nat -F; iptables -t mangle -F
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -m state --state NEW -i ! eth0 -j ACCEPT
iptables -A INPUT -p icmp -j ACCEPT
iptables -P INPUT DROP

#for at aabne for port 80
#iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
#iptables -A INPUT -p tcp -m tcp --dport 21 -j ACCEPT
#iptables -A INPUT -p tcp -m tcp --dport 20 -j ACCEPT

#for sshd
iptables -A INPUT -p tcp -m tcp --dport 22 --syn -j ACCEPT

og derefter kørt
Code:
chmod 700 /etc/init.d/firewall
&
/etc/init.d/iptables save


hvorpå jeg har restartet min firewall
Code:
 /etc/init.d/iptables restart


og jeg kan ikke få min dhcp server til at virke for migne klienter før at min firewall virker.
Det virker lidt som den ikke kigger i firewll filen da jeg har prøvet at fjerne linjen
#for sshd
iptables -A INPUT -p tcp -m tcp --dport 22 --syn -j ACCEPT
og jeg kan stadig logge på med ssh
Back to top
View user's profile Send private message
patrix_neo
Guru
Guru


Joined: 08 Jan 2004
Posts: 520
Location: The Maldives

PostPosted: Tue Feb 22, 2005 2:27 pm    Post subject: Reply with quote

Om jag fattat det rätt så har du din egna dhcpd körandes på en server? Då behöver du öppna portarna 67:68 på den servern så dina klienter kommer åt den. Har för mig det skall vara 67:68, tcp ...kolla i /etc/services vilka portar dhcp körs på för att vara säker.

Så här ser min kommenterade dhcp line ut:

# Uncomment to get dhcpd work
# $IPTABLES -A INPUT -i $INETIF -d $INETIP -p udp --dport 67:68 --sport 67:68 -j ACCEPT

I detta exempel finns dhcpd på samma maskin som FW.

OBS! Har aldrig testat detta, men har raden med i fall jag skulle sätta på dhcpd på min maskin. En idé är att du går med i maillistan för iptables: http://lartc.org/#mailinglist
_________________
Life is a fog where some thinks to know where to go
To make an error is human, letting it be is the error.
Deus Vult
Back to top
View user's profile Send private message
andybrandorff
n00b
n00b


Joined: 03 Aug 2004
Posts: 57
Location: denmark

PostPosted: Wed Feb 23, 2005 10:53 pm    Post subject: Reply with quote

Tak for hjælpen nu virker det
Back to top
View user's profile Send private message
andybrandorff
n00b
n00b


Joined: 03 Aug 2004
Posts: 57
Location: denmark

PostPosted: Wed Feb 23, 2005 11:46 pm    Post subject: Reply with quote

Det var lige tidligt nok.
for når jeg rebooter så virker det ikke.
så skal jeg ind og sige
Code:
/etc/init.d/iptables save

&
Code:
/etc/init.d/iptables restart

hvorfor husker den det ikke når jeg har save
Back to top
View user's profile Send private message
patrix_neo
Guru
Guru


Joined: 08 Jan 2004
Posts: 520
Location: The Maldives

PostPosted: Sat Feb 26, 2005 9:26 am    Post subject: Reply with quote

Jag skall i ärlighetens namn säga att jag inte använder mig av iptables save/load. Jag kör allting från scripts under root.

Får hoppas någon annan kan hjälpa dig där. :roll:
_________________
Life is a fog where some thinks to know where to go
To make an error is human, letting it be is the error.
Deus Vult
Back to top
View user's profile Send private message
monotux
l33t
l33t


Joined: 09 Sep 2003
Posts: 751
Location: Stockholm, Sweden

PostPosted: Sun Mar 20, 2005 11:22 am    Post subject: Reply with quote

Om jag har läst vad du har gjort nu, så har du inte startat själva skriptet!
Du har kört en
Code:
chmod 700 /etc/init.d/firewall
och sedan en
Code:
/etc/init.d/iptables save
men du har inte kört själva skriptet, så att dina iptables-regler sparas.

Jag föreslår att du kör en
Code:
/etc/init.d/firewall start
och sedan en
Code:
/etc/init.d/iptables save

_________________
Computer science is no more about computers than astronomy is about telescopes.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Scandinavian All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum