LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-03-2003, 11:00 AM   #1
e1000
Member
 
Registered: Oct 2003
Location: California
Distribution: Ubuntu
Posts: 582

Rep: Reputation: 30
configuring IPtables


how do i configure IPtables on my slackware system?

I have heard that IPtables doesnt come pre-configured with slackware (like it does with some other big distros), so my question is... how do i configure and start iptables, and how do i get it to start on startup.
 
Old 11-03-2003, 11:19 AM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Taken from the Security reference thread in the Security forum: http://www.linuxquestions.org/questi...threadid=45261

Nice link for IPTables tutorial found here: http://iptables-tutorial.frozentux.n...-tutorial.html

There are also a few others in that thread, check them out as they should provide the information your seeking.
 
Old 11-03-2003, 11:46 AM   #3
dirren
LQ Newbie
 
Registered: May 2003
Location: Stockholm / Sweden
Distribution: Slackware
Posts: 14

Rep: Reputation: 0
Try this link: http://simplylinux.punted.net/Usingiptables.html
 
Old 11-03-2003, 08:49 PM   #4
matt3333
Member
 
Registered: Dec 2002
Location: Winnipeg, Manitoba, Canada
Distribution: Slackware
Posts: 371

Rep: Reputation: 30
Ok i followed the link dirren sent and i downloaded arno-iptables-firewall.tgz or whatever it is. Anyways i downloaded it and did what he said to do and i keep getting this error when i try to start iptables:

root@DarkPunk:/home/Matt/arno# /etc/rc.d/rc.iptables start
Arno's IPTABLES Firewall Script v1.8.1RC-2
---------------------------------------------------------------
/etc/rc.d/rc.iptables: /etc/iptables-firewall.conf: line 48: syntax error near unexpected token `('
/etc/rc.d/rc.iptables: /etc/iptables-firewall.conf: line 48: `# connected to doesn't have an IP, you should leave the MODEM_xxx options disabled (default)! #'
ERROR: The required variable EXT_IF is empty!
Please, correct this by checking the settings in the configuration file.
root@DarkPunk:/home/Matt/arno#

I know it says EXT_IF is empty but i made sure it had "eth0" in it so it looks like this EXT_IF="eth0" like he said to do in the readme type file on the site ill post the section that i put this in maybe i edited the wrong section if anyone else gets this error or had this error and fixed it or EVEN knows how to fix this PLZ HELP ME anyways here it is:

# Required variables for correct operation #
############################################
IPTABLES="/usr/sbin/iptables" # Location of the iptables-binary (use 'locate
iptables' or 'whereis iptables'
# to manually locate it).
EXT_IF="eth0" # The external interface that will be protected (and used
as internet connection)
# This is probably ppp+ for (A)DSL (for non-transparant (A)DSL r$
# otherwise it should be "ethX" (ex. eth0)
EXT_IF_DHCP_IP=1 # Enable if THIS machines (dynamically) obtains its IP
through DHCP (from your ISP)

plz help me thanx!!!

Matt3333
 
Old 11-04-2003, 03:41 AM   #5
dirren
LQ Newbie
 
Registered: May 2003
Location: Stockholm / Sweden
Distribution: Slackware
Posts: 14

Rep: Reputation: 0
This is how yours looks like:

# Required variables for correct operation #
############################################
IPTABLES="/usr/sbin/iptables" # Location of the iptables-binary (use 'locate
iptables' or 'whereis iptables'
# to manually locate it).
EXT_IF="eth0" # The external interface that will be protected (and used
as internet connection)
# This is probably ppp+ for (A)DSL (for non-transparant (A)DSL r$
# otherwise it should be "ethX" (ex. eth0)
EXT_IF_DHCP_IP=1 # Enable if THIS machines (dynamically) obtains its IP
through DHCP (from your ISP)

This is how it should look:

# Required variables for correct operation #
############################################
IPTABLES="/usr/sbin/iptables" # Location of the iptables-binary (use 'locate
#iptables' or 'whereis iptables'
# to manually locate it).
EXT_IF="eth0" # The external interface that will be protected (and used
#as internet connection)
# This is probably ppp+ for (A)DSL (for non-transparant (A)DSL r$
# otherwise it should be "ethX" (ex. eth0)
EXT_IF_DHCP_IP=1 # Enable if THIS machines (dynamically) obtains its IP
#through DHCP (from your ISP)

See the difference? gl
 
Old 11-04-2003, 10:19 AM   #6
matt3333
Member
 
Registered: Dec 2002
Location: Winnipeg, Manitoba, Canada
Distribution: Slackware
Posts: 371

Rep: Reputation: 30
Yup i sure do once something gets tabed to the other line it has to be commented?? is that what your saying?? Thanx for ur replys!!!


Matt3333
 
Old 11-04-2003, 11:09 AM   #7
e1000
Member
 
Registered: Oct 2003
Location: California
Distribution: Ubuntu
Posts: 582

Original Poster
Rep: Reputation: 30
nice link, but i dont understand a few parts.

--------------------------------------------------
IPTABLES="/usr/sbin/iptables" # Do "whereis iptables" to find out where it is
EXT_IF="eth0" <<1>>
DYNAMIC_IP=1 <<2>>
#MODEM_IF="eth0"
MODEM_IP="192.168.1.1" # This is your router or ISP <<3>>
MODEM_IF_IP="127.0.0.1" # This is your PC. Do "ifconfig" to find out eth0 inet addr
-------------------------------------------------

1) do i just put my modem's name here? like for me its name is /dev/ttyHSFS0

2) so i put this if im on a dial up with a dynamic IP?

3) i dont understand what to put here.
 
Old 11-04-2003, 02:47 PM   #8
matt3333
Member
 
Registered: Dec 2002
Location: Winnipeg, Manitoba, Canada
Distribution: Slackware
Posts: 371

Rep: Reputation: 30
Ok awsome i got it working thanx dirren. Hm does anyone know if its possible to like congifure it so that port 21,20...etc are closed but when i want to just like shut off iptables or something like that?? The resone why im asking is obiously b/c i want to use my ftp and ssh for transfering stuff from my comp to my work one?? But like during the day i want ftp and ssh closed and like the only ports i will need open during the night is 21,20 and the rest of them closed. If this is making sense Plz Help me Thanx for ur help so far.


Oh and e1000 You dont need to put anything after EXT_IF="eth0" here ill show you:

IPTABLES="/usr/sbin/iptables" # Do "whereis iptables" to find out where it is
EXT_IF="eth0" (ok here u dont need anything after the quotes but if a line comes down into here like this then u have to comment it................................................................)
DYNAMIC_IP=1 (Here just leave it)
#MODEM_IF="eth0"
MODEM_IP="192.168.1.1" # This is your router or ISP ( This one u can leave blank i believe its default to leave it blank along with MODEM_IF_IP Just watch out for the line coming down or if does just make sure u comment it in like shown above my post)
MODEM_IF_IP="127.0.0.1" # This is your PC. Do "ifconfig" to find out eth0 inet addr

I hope that made sense!!!!!!! Anyways good luck!



Matt3333
 
Old 11-09-2003, 02:51 AM   #9
e1000
Member
 
Registered: Oct 2003
Location: California
Distribution: Ubuntu
Posts: 582

Original Poster
Rep: Reputation: 30
ok, I did "iptables -xnvL" and i got a bunch of output but it only showed IP adresses as 0.0.0.0, there wasnt one valid ip address in there, is this cause its not working, or cause im on a dynamic IP?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Configuring iptables at start up gezzam Mandriva 2 03-24-2005 01:12 AM
configuring iptables to allow ping notolerance Linux - Security 2 01-10-2005 07:01 PM
Newbie needs help configuring iptables imsam Linux - Security 1 10-30-2004 06:05 AM
need help configuring IPTables to allow Samba through Hockeyfan Linux - Networking 2 05-31-2004 09:47 PM
Configuring IPTABLES goldfish Linux - Newbie 6 10-15-2003 04:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration