Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Originally posted by meinzorn hmm.. kinda an issue, not that big of one I guess....
but pre this, I had apache set up, as well as proftpd and they worked fine...
now they aren't working.. is it related, or did I change something without realizing it ?
ssh also isn't working...... which is more of an issue than anything... I planned on using that mostly when I needed to do anything with the machine.
well, yeah, or the local network..
and when I try to connect with ssh, it just times out.
same with http
no problem, we just need to add a few rules to the script allowing http, ftp, and ssh (the original script i wrote was designed for complete stealth on the external interface, as i didn't know you were running services on it)...
here you go (the relevant rules are in bold):
here you go:
echo "0" > /proc/sys/net/ipv4/ip_forward
echo "1" > /proc/sys/net/ipv4/tcp_syncookies
echo "0" > /proc/sys/net/ipv4/tcp_timestamps
echo "1" > /proc/sys/net/ipv4/conf/all/rp_filter
echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
echo "0" > /proc/sys/net/ipv4/conf/all/accept_source_route
echo "1" > /proc/sys/net/ipv4/conf/all/secure_redirects
echo "1" > /proc/sys/net/ipv4/conf/all/log_martians
$IPT -F -t nat
$IPT -F -t mangle
$IPT -X -t nat
$IPT -X -t mangle
$IPT -P INPUT DROP
$IPT -P FORWARD DROP
$IPT -P OUTPUT ACCEPT
$IPT -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPT -A INPUT -i lo -m state --state NEW -j ACCEPT
$IPT -A INPUT -p ICMP --icmp-type 8 -m state --state NEW -j ACCEPT
$IPT -A INPUT -p TCP --dport 21 -m state --state NEW -j ACCEPT
$IPT -A INPUT -p TCP --dport 22 -m state --state NEW -j ACCEPT
$IPT -A INPUT -p TCP --dport 80 -m state --state NEW -j ACCEPT
$IPT -A INPUT -j LOG --log-prefix "INPUT DROP: "
$IPT -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPT -A FORWARD -i $LAN_IFACE -o $INET_IFACE \
-m state --state NEW -j ACCEPT
$IPT -A FORWARD -j LOG --log-prefix "FORWARD DROP: "
$IPT -t nat -A POSTROUTING -o $INET_IFACE -j MASQUERADE
echo "1" > /proc/sys/net/ipv4/ip_forward
echo "So let it be written. So let it be done."
BTW, that script is logging every packet that gets blocked by the firewall... you can see what packets are getting blocked in "real-time" by doing a:
tail -f /var/log/syslog
(you need to have sysklogd installed for this to work)
this is good for troubleshooting and stuff... like, for example when you weren't able to SSH to the box - by monitoring the log file you would have noticed the port 22 packets getting blocked... so you would have known it was a firewall issue right away...
it's also good for seeing all the weird spiders that crawl all over the internet... hehe...