• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

iptables script.....

Dark Atheist

Staff member
Political User
on which i think i have dropped the proverbial nad

iptables -F INPUT
iptables -P INPUT DROP
iptables -F OUTPUT
iptables -A INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p udp -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p udp -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -i lo -j ACCEPT
accept_port="80 443 2010 9000:9000"
names="some.dns.name1 some.dns.name2 some.dns.name3 some.dns.name4"
iptables -A INPUT -i $ext_if -j DROP
iptables -A INPUT -i $int_if -s -j ACCEPT
iptables -A INPUT -i $ext_if -s -j ACCEPT
for ip in $names
for port in $accept_ports
iptables -A INPUT -i $ext_if -s $ip --dport $ip --syn -m state --state NEW -j ACCEPT

is what i believe should give me control about who can access certain things on my server (web fftp)

thing is since running this script it is also blocking me on the lan too!!!! i cant see web pages or connect to my own ftp :(

any Sharpe eyed person out there see where i messed up (and no saying well you wrote it is neither a reason nor helpful, it also wont get you reps or a cookie)

Dark Atheist

Staff member
Political User
seems it was iptables -A INPUT -i $ext_if -j DROP that line looks like i might have it in the rong place - still least i can connect to my server now, and also shame i have blocked other ports :p still i can add them

Members online

Latest profile posts

Perris Calderon wrote on Electronic Punk's profile.
Ep, glad to see you come back and tidy up...did want to ask a one day favor, I want to enhance my resume , was hoping you could make me administrator for a day, if so, take me right off since I won't be here to do anything, and don't know the slightest about the board, but it would be nice putting "served administrator osnn", if can do, THANKS

Been running around Quora lately, luv it there https://tinyurl.com/ycpxl
Electronic Punk wrote on Perris Calderon's profile.
All good still mate?
Hello, is there anybody in there? Just nod if you can hear me ...
What a long strange trip it's been. =)

Forum statistics

Latest member