A
A
Andrew2019-06-08 21:26:03
iptables
Andrew, 2019-06-08 21:26:03

How to fix iptables?

Hello.
I'm struggling with the old Linux kernel (2.4.19) with iptables version 1.2.2
This version is needed for one old software to work.
An error occurs when starting and configuring iptables through a script.
Gives an error:
5cfbfd694a3ed588908245.jpeg
As a result, I have a file /etc/sysconfig/iptables of the following form:
https://pastein.ru/t/OH
Here is the entire initial configuration script:
https://pastein.ru/t/3H
The error in line 285 is the second from the end "esac" command
According to the result, iptables does not work: it does not accept rules and does not write them to the /etc/sysconfig/iptables config
Help me figure it out!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hint000, 2019-06-09
@spiller1975

The error in line 285 is the second "esac" command from the end
Well, if you count the lines according to the posted script, then line 285 is
[ -e "$VAR_SUBSYS_IPTABLES" ] && restart, and not "esac" at all.
On a cursory review, I noticed one error in the script: lines 125-126 must be deleted, this is an erroneous copy-paste of the lines following them
$IPTABLES -t mangle -P PREROUTING $policy \
                    && $IPTABLES -t mangle -P POSTROUTING $policy \

                $IPTABLES -t mangle -P PREROUTING $policy \
                    && $IPTABLES -t mangle -P POSTROUTING $policy \
                    && $IPTABLES -t mangle -P INPUT $policy \
                    && $IPTABLES -t mangle -P OUTPUT $policy \
                    && $IPTABLES -t mangle -P FORWARD $policy \
                    || let ret+=1
                ;;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question