C
C
click_f2016-11-03 21:52:38
linux
click_f, 2016-11-03 21:52:38

How to add kernel options to iptables?

There are iptables parameters

*filter
###############
# VARIABLE DEFINITIONS
IPTABLES=/sbin/iptables

#Your DHCP Server for input of ICMP packets
DHCPSERVER=127.0.0.1
PUBIF=wlan0

# KERNEL PARAMETER CONFIGURATION
#
# DROP ICMP ECHO-REQUEST MESSAGES SENT TO BROADCAST OR MULTICAST ADDRESSES
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
#
....
....
COMMIT

the problem is that it is not possible to add this config to
iptables-restore < iptables.rules
, it swears on the 4th line ( IPTABLES=/sbin/iptables ), ... the binary is located exactly at this address. What could be the problem?
You can manually add all the rules, but in this case, how do you add kernel parameters as well?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Max, 2016-11-03
@MaxDukov

the format does not imply any variables and echo. it's more like a script for you .... probably in the file somewhere further there will be "IPTABLES -A ..."

S
Sergey Evstifeev, 2016-11-04
@eserDEN

Add to the beginning of the file: !#/bin/bash
and give execution permissions to your script #chmod +x path_to_script

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question