Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N
#!/bin/sh
### BEGIN INIT INFO
# Provides: rc.local
# Required-Start: $network $syslog
# Required-Stop: $network $syslog
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description: whatever
### END INIT INFO
#CLEAR ALL IPTABLE RULES
iptables -F
iptables -X
# DROP ALL INCOMING TRAFFIC
iptables -P INPUT DROP
# DROP ALL FORWARDING TRAFFIC
iptables -P FORWARD DROP
# ALLOW OUTBOUND TRAFFIC
iptables -P OUTPUT ACCEPT
# ALLOW SYSTEM TRAFFIC
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
# ALLOW CERTIAN INBOUND TRAFFIC
iptables -A INPUT -s 127.0.0.1 -j ACCEPT
iptables -A INPUT -s 192.168.0.0/255.255.0.0 -j ACCEPT
iptables -A INPUT -s <voip ip> -j ACCEPT
cd /etc/init.d
chmod 755 /etc/init.d/rclocal
chkconfig --add rclocal
cd /etc/init.d
chmod 755 /etc/init.d/rclocal
chkconfig --add rclocal
Note: This output shows SysV services only and does not include native
systemd services. SysV configuration data might be overridden by native
systemd configuration.
rclocal 0:off 1:off 2:off 3:on 4:off 5:on 6:off
/etc/sysconfig/SuSEfirewall2
#FW_CUSTOMRULES=""
to this
FW_CUSTOMRULES="/etc/sysconfig/scripts/SuSEfirewall2-custom"
/etc/sysconfig/scripts/SuSEfirewall2-custom
fw_custom_before_port_handling() {
# these rules will be loaded after the anti-spoofing and icmp handling
# and after the input has been redirected to the input_XXX and
# forward_XXX chains and some basic chain-specific anti-circumvention
# rules have been set,
# but before any IP protocol or TCP/UDP port allow/protection rules
# will be set.
# You can use this hook to allow/deny certain IP protocols or TCP/UDP
# ports before the SuSEfirewall2 generated rules are hit.
iptables -F
iptables -X
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A INPUT -s 127.0.0.1 -j ACCEPT
iptables -A INPUT -s 192.168.0.0/255.255.0.0 -j ACCEPT
Iptables -A INPUT -s <voip ip> -j ACCEPT
true
}
Users browsing this forum: Bing [Bot], Majestic-12 [Bot] and 75 guests