UbuntuThis forum is for the discussion of Ubuntu 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.
sup ya'll. Recently my iptables has been acting weird; i have not installed anything that might cause this except maybe vmplayer.
During boot i see an unexpected operator error when starting iptables- firewall.
also whenever i try iptables-rules, i get
Code:
tidiman07@Box1:~$ iptables-rules
Which ports do you want to open ?
Allow ping (y/n)? [y] y
[: 33: ==: unexpected operator
[: 33: ==: unexpected operator
[: 33: ==: unexpected operator
[: 33: ==: unexpected operator
Allow ftp (file transfert) (y/n)?
The iptables still works, i have firestarter so i see blocked connections. I tried reinstalling iptables, still get the same error.
what does
which iptables-rules
or
locate iptables-rules
and
iptables-rules --version
give you ?
iptables-rules --help
and
man iptables-rules
might show where the file/s are saved
i tried removing firehol, cause i just installed it and i got same error, i compared iptables in /etc/init.d/iptables to another in my friend's pc and they are the same.
sorry, it appears iptables had blocked my browser, fixed now. To be clear, the errors i get are for all commands issued during iptables-rules. here it is in its entirety.
I copy/pasted the following chunk of your code into a script here and it worked properly. Was your version of the script created outside of Linux? If the line endings are DOS based instead of Linux that can cause problems with scripts.
Code:
#! /bin/sh
#
# Initialize the rules with iptables.
#
ROOT_UID="0"
#Ctrl-C trapping
trap ctrlc INT
ctrlc()
{
echo -e "\nAborted by user."
rm -rf $TMP_DIR
exit 2
}
#Check if run as root
if [ "$UID" -ne "$ROOT_UID" ] ; then
echo "You must be root to do that!"
exit 1
fi
echo "Which ports do you want to open ?"
allow_icmp="0"
echo -n "Allow ping (y/n)? [y] "
read input
if [ -z "$input" ] || [ "$input" == "y" ] || [ "$input" == "yes" ] || [ "$input" == "Y" ] || [ "$input" == "YES" ] ; then
allow_icmp="1"
fi
Last edited by gilead; 11-21-2006 at 06:52 PM.
Reason: Mis-copied the 'if' statement
no, its the script that was default install, it was working fine until a couple of days ago. maybe it is other applications interfering, i removed all recent applications and i still get the same problem. The firewall works but i dont like seeing lines of error codes during boot.
ok, this is becaming an issue; now whenver i reboot iptables resets rules and blocks everything. It took me like 10 min right now to figure it out, i had to add rules for http, https, and dns. This sucks! Im gonna try to remove it and see what happens.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.