Computing.Net > Forums > Linux > iptables - filtering question

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

iptables - filtering question

Reply to Message Icon

Name: Matt
Date: July 9, 2002 at 02:56:40 Pacific
Comment:

Hi there

I am trying to filter certain areas on a small LAN from seeing each other. I have 3 interfaces:
Eth0: Connected to a dsl modem to the Internet (live address)
Eth1: 192.168.0.1/24
Eth2: 172.16.0.1/16

I basically want to restrict Eth2 from doing very much at all (not accessing the net or 192.168.0.0/24).
The problem is that it's been fine to set up the filters to stop access to all of the destinations *except* the address that is assigned to the actual interface of the linux box.

E.g.: A host on 172.16.0.0/16 can no long ping any host on 192.168.0.0/24 except for 192.168.0.1 which is assigned to eth1. Likewise for the Internet side: 172.16.0.0/16 cannot get out on the net (even with nat), but it can get to the live address assigned to interface eth0.

Have been playing around with various ways of filtering, but cant stop this.

Any ideas on blocking this behavious?

TIA



Sponsored Link
Ads by Google

Response Number 1
Name: junky_toof
Date: July 9, 2002 at 13:22:06 Pacific
Reply:

iptables -A INPUT -s 172.16.0.0/16 -d !
172.16.0.0/16 -j DROP
iptables -A FORWARD -s 172.16.0.0 -d !
172.16.0.0/16 -j DROP
iptables -A OUTPUT -s 172.16.0.0/16 \
-d ! 172.16.0.0/16 -j DROP

Hope you get the idea.
MMD


0

Response Number 2
Name: Matt
Date: July 9, 2002 at 18:23:05 Pacific
Reply:

Thanks, but it doesnt solve my problem. I understand your rules (basically anything with a source of 172.16.0.0/16 and a destination of anything *other* than 172.16.0.0/16 gets dropped) but if Im on a host on 172.16.0.0/16, I can still ping the eth1 interface address of 192.168.0.1 (even though I cant ping anything on the rest of that network).

It seems like these rules do not apply to the actual interface address of the router (linux box)

Any other thoughts on this?

Matt


0

Response Number 3
Name: junky_toof
Date: July 9, 2002 at 20:07:42 Pacific
Reply:

Matt,
I would assign an implicit deny for that
address then. That is strange however.
It makes me think that I would like to have
you insert this rule and tell me what
happens.
If this works you may just need to reorder
your rulesets. The order of the rules is
very important.

iptables -I INPUT -s 172.16.0.0/16 -d
192.168.0.1 -j DROP


0

Response Number 4
Name: Matt
Date: July 9, 2002 at 21:11:16 Pacific
Reply:

junky_toof

Sorry, it does work, the INPUT chain is what I needed.

Thanks

Matt


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


mandrake 8.2 modem and so... VMWARE



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: iptables - filtering question

DNS Server IPTables Config Question www.computing.net/answers/linux/dns-server-iptables-config-question/30020.html

IPTables forward question www.computing.net/answers/linux/iptables-forward-question/27798.html

How run iptables in redhat 7.0 www.computing.net/answers/linux/how-run-iptables-in-redhat-70/13930.html