SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I cannot get Iptables to work, i used the command #which iptables to see if it could find it and it says
"which: no itables in (/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib/kde4/libexec:/usr/lib/qt/bin:/usr/share/texmf/bin)"
In the package manager it says iptables is installed, is there any way to reinstall it to fix the problem I am having? I tried to reinstall it myself but it doesn't put the files in sbin or any of the normal locations the files should be in.
It may be a cut&paste problem, but the text you posted says "no itables" instead of "no iptables" (missing p). Other than that, /usr/sbin is in the search path, so I'd either check the iptables package is really installed, or there's a missing symlink:
I accidently put it in wrong, it says it is installed but there are no files in the /usr/sbin/iptables/ the file is empty. The whole reason I want to get this to work is to use APF Firewall and it requires iptables to be installed. And APF Firewall cannot find the required files for it to work. So could you possibly guide me through how to reinstall iptables or somehow fix this. Thanks
You do not have any mirror selected in /etc/slackpkg/mirrors
Please edit that file and uncomment ONE mirror. Slackpkg
only works with ONE mirror selected.
root@MTI1997-Linux:~# slackpkg upgrade-all
This appears to be the first time you have run slackpkg.
Before you install|upgrade|reinstall anything, you need to uncomment
ONE mirror in /etc/slackpkg/mirrors and run:
# slackpkg update
You can see more information about slackpkg functions in slackpkg manpage.
I did all that and when I try to run apf firewall still it says it still cant find iptables, it is looking in /sbin/iptables/ and that is not a directory at all. But there is iptable files in /usr/local/sbin/
When the iptables package is installed correctly, the which command should show the following on Slackware:
which iptables
/usr/sbin/iptables
From where did you get this apf firewall? From what I see searching the web, this is some kind of firewall configuration script. That script is not part of the stock Slackware. More than likely the APF firewall script presumes a location of /sbin/iptables rather than /usr/sbin/iptables, which would explain the failure.
A traditional way of configuring iptables in Slackware is to use the following web page, which will generate an rc.firewall script for Slackware:
I got apf from this site http://www.rfxn.com I guess ill figure this out later, I made the rc.firewall script and put it in the right directory and im guessing iptables should start everytime I run slackware.
I did chmod 755 etc/rc.d/rc.firewall/ and then restarted. To make sure it was working I put in iptables -L -n and it outputted a bunch of things, whihc im guessing it is working now.
root@MTI1997-Linux:~# iptables -L -n
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
bad_packets all -- 0.0.0.0/0 0.0.0.0/0
DROP all -- 0.0.0.0/0 224.0.0.1
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED
tcp_inbound tcp -- 0.0.0.0/0 0.0.0.0/0
udp_inbound udp -- 0.0.0.0/0 0.0.0.0/0
icmp_packets icmp -- 0.0.0.0/0 0.0.0.0/0
DROP all -- 0.0.0.0/0 0.0.0.0/0 PKTTYPE = broadcast
LOG all -- 0.0.0.0/0 0.0.0.0/0 limit: avg 3/min burst 3 LOG flags 0 level 4 prefix "INPUT packet died: "
Slackware puts iptables in /usr/sbin, whereas distributions like Debian put it in /sbin. Your script isn't portable, meaning it doesn't contain a line like:
Code:
IPT=$(which iptables)
So that's why it doesn't work.
Advice: don't bother with your script, and simply write an iptables firewall yourself. It's easier than you might think.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.