Linux - Security This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
11-30-2005, 01:27 PM
|
#1
|
Member
Registered: May 2004
Posts: 46
Rep:
|
iptables question
hi need to block private i.p addresses on class a and class b networks entering through the external interface on my firewall, any suggestions on an iptables command?
cheers
10.0.0.0 to 10.255.255.255
172.16.0.0 to 172.31.255.255
|
|
|
11-30-2005, 04:29 PM
|
#2
|
Senior Member
Registered: Nov 2002
Location: British Columbia, Canada
Distribution: Gentoo x86_64; FreeBSD; OS X
Posts: 3,764
Rep:
|
Code:
# /sbin/iptables -A INPUT -p tcp -s 10.0.0.0/8 -i eth0 -j DROP
I'll let you figure out the cidr notation for the second one...
How do you suppose traffic from private IPs will get routed to your external interface? Are you just trying to block spoofs?
In any event, it is generally wiser to disallow _everything_ by default then add rules to allow stuff, rather than the inverse...
|
|
|
11-30-2005, 04:53 PM
|
#3
|
Member
Registered: May 2004
Posts: 46
Original Poster
Rep:
|
cheers for the help, is it dangerous to disallow everything as im using telnet to connect to the firewall?
|
|
|
11-30-2005, 06:51 PM
|
#4
|
Member
Registered: May 2004
Location: Malaysia
Distribution: Mandrake,Slackware,RedHat
Posts: 157
Rep:
|
i just think that u should use SSH instead of telnet. It is more secure because the connection is encrypted.
|
|
|
12-01-2005, 05:10 AM
|
#5
|
Member
Registered: May 2004
Posts: 46
Original Poster
Rep:
|
so I should just block everything and just allow 192.168.0.0 to 192.168.255.255?
switched to ssh now cheers
|
|
|
12-01-2005, 05:23 AM
|
#6
|
Senior Member
Registered: Nov 2002
Location: British Columbia, Canada
Distribution: Gentoo x86_64; FreeBSD; OS X
Posts: 3,764
Rep:
|
Do 192.168.0.0 to 192.168.255.25 need to access you box? Only allow what needs to be allowed...
Perhaps you should explain your setup in detail, as well as what other boxes/IPs need access to it, and someone can probably give you more useful answers. You seem to be confusing the difference between untrusted connection (ie: those from the Internet) and trusted ones (ie: those from your private LAN). Presumably you have two interfaces on the firewall. Each will need different rules, because they are two vastly different ingress points. Again, more detail on your setup, and your goals, would help here.
BTW, good on you for using ssh. telnet is terribly insecure.
|
|
|
12-01-2005, 05:26 AM
|
#7
|
Member
Registered: May 2004
Posts: 46
Original Poster
Rep:
|
the firewall is to protect 2 machines on the 172.24.15.0 subnet, on the other side of the firewall is lots of 192.168.xxx.xxx networks
yeah i use a 192.168.x.x machine to ssh in
Last edited by cashton2k; 12-01-2005 at 05:38 AM.
|
|
|
12-01-2005, 05:35 AM
|
#8
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
Are you sure that you have your inside and outside IPs straight. Both the 10.x.x.x and 192.168.x.x IP addresses are private and should not be coming in from the outside. These ranges definitely should be blocked.
|
|
|
12-01-2005, 08:43 AM
|
#9
|
Member
Registered: May 2004
Posts: 46
Original Poster
Rep:
|
yeah its right because the external interface on the firewall is connected to a large network before it gets to the internet
|
|
|
All times are GMT -5. The time now is 10:44 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|