Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi I'm having some trouble w/ getting iptables to work on Redhat 7.2
2.4.2-2 kernel, iptables-1.2.1a-1
I'm doing something very simple, just trying to get it to forward port 80 to an inside Ip (10.0.0.55)
from an outside ip. I scripted my setup below, and I can't see anything wrong, I copied the iptables command
directly from the NAT 2.4 kernel HOWTO. Any ideas? I've been dealing w/ this problem for a month and have totally run into a wall.
thanks,
didget
iptables -A INPUT -p TCP -m state --state NEW --destination-port 80 -j LOG --log-prefix "HTTP inbound: "
iptables -A INPUT -p TCP -m state --state NEW --destination-port 80 -j ACCEPT
iptables -A PREROUTING -p TCP -m state --state NEW --destination-port 80 -j ACCEPT
----------------
Test it and if it doesn't work check the log file.
Also make sure -i eth0 is the external interface card.
Otherwise your script looks correct to me.
You don't need the Accept rules but leave them just incase.
but nothing from the ip I'm trying to connect from, and nothing about the outside ip(eth0)? I also know it's nothing physical because I can connect to my inside ip through the firewall w/ lynx.
iptables -t nat -A PREROUTING -p tcp --dport 80 -i eth0 -j LOG --log-level info --log-prefix "** PREROUTE HTTP **"
--------------
Try this, it should log what's happening in /var/log/messages
The "dropping untracked packet" message is caused because Multicast or Broadcast requests are trying to go through the connection tracking module for prerouting.
These will stop if you put rules in to stop them from entering the prerouted tables.
iptables v1.2.3: log-level `info' ambiguous
Try `iptables -h' or 'iptables --help' for more information.
iptables v1.2.3: log-level `info' ambiguous
Try `iptables -h' or 'iptables --help' for more information.
iptables v1.2.3: log-level `info' ambiguous
Try `iptables -h' or 'iptables --help' for more information.
-the error I get from your script. Did it work on your setup?
does it show you:
*.info;mail.none;authpriv.none;cron.none /var/log/messages
if not then change "info" to something in your syslog.conf file that logs to /var/log/messages file.
Change the line as I put a -i instead of -o in it:
iptables -A OUTPUT -i eth0 -p tcp -s your_external_ipaddress --sport 80 -d 0/0 --dport 1024:65535 -j LOG --log-level info --log-prefix "** OUTGOING HTTP **"
It does give that response but I still get the same error. Could you possibly email me then we could meet and compare notes? I followed your steps to a t, and also have like four other bbs's trying to help me out, I also setup another box w/ a similar setup except ipchains and RH 6.2. Still nuthin. Its not a difficult concept, I think I'm just missing something minor.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.