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.
I know this is an old post, but here it is 2010 and I cant seem to find any answer (that i understand) anywhere on google.
Is there a way to specify multiple src ips? I am filtering the internet for the safety of my kids, but I need to bypass that filter for my computer, my xbox and my server.
This is the current rule that allows my xbox to bypass the filter, but no matter what I have tried, I cant seem to specify more than 1 ip without having to specify an entire subnet.
I've moved your post to a thread of its own. Please don't resurrect dead threads unless it's absolutely necessary. With regards to your question, AFAIK things haven't changed (there isn't a multiple IP match). In other words (assuming I'm right), you're gonna have to use individual rules for your PC, Xbox, and server. It's just a matter of sending packets with those source addresses to ACCEPT, before they can get sent to REDIRECT. For example (using three hypothetical IPs for your non-filtered boxes):
EDIT: Just wanted to add that there's also a way to do this with IP ranges (it's still not the same as being able to specify multiple IPs in a single rule, though). This would, of course, require your three IPs to be contiguous. Example:
These rules make it so that any packet with a source address of 172.21.27.4, 172.21.27.6, or 172.21.27.20 gets sent to ACCEPT right away, so that it can be dealt with in the FORWARD chain. In the FORWARD chain, the first rule which this packet would match is:
Quote:
Code:
2 124 ACCEPT all -- eth1 eth2 0.0.0.0/0 0.0.0.0/0
...which sends the packet to ACCEPT. Then, the packet gets its source address edited in the POSTROUTING chain:
Quote:
Code:
Chain POSTROUTING (policy ACCEPT 7031 packets, 423K bytes)
pkts bytes target prot opt in out source destination
0 0 MASQUERADE all -- * eth2 0.0.0.0/0 0.0.0.0/0
...and it's on its final journey out to the WAN.
If that packet had a source address which didn't match either of those three IPs, and it had a destination port of 80/TCP, then it would match the REDIRECT rule and as such would be intercepted. There must be something I'm missing here, because like I said, I'm not sure why this wouldn't work as it is.
I'd suggest adding some LOG rules to get a better idea of what's happening.
I put together this script for you. It basically gives you a clean slate, without touching your INPUT or OUTPUT chains. Maybe you can run your tests after running this script and see if anything changes? If not, something should show up in the log file, as all filtered packets get logged in this setup. Here it is:
Thanks a lot win32sux. I really wasnt expecting anyone to put that much effort into it. I havent been ignoring you, just really busy right now. As soon as I get a chance, I will get back on this iptables issue and try out your script.
I had a few minutes to try your script. It errored out on me, but I dont have time to troubleshoot it right now. I have a work around that is getting me by for now. I have basically created 3 firewall.sh scripts. 1 for each system (ip). When I need a specific system to not go through 8080, i run the specific firewall.sh script for that system. I know its cheesy, but its working for now until I get time to continue troubleshooting it.
The only one that is a must for now is the xbox. It has to bypass filter for live to work. There is no internet surfing on the server and my personal computer, I can deal with until the issue is resolved.
Your script returned the
Bad argument try iptables -h for help error. I will be sure to update you with any findings or an updated script.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.