View previous topic :: View next topic |
Author |
Message |
jrogby n00b
Joined: 02 Aug 2006 Posts: 10
|
Posted: Wed Aug 02, 2006 1:43 pm Post subject: Routing between two private subnets |
|
|
If you take a look at this picture:
http://www.fw1.mumindalen.info/pictures/firewalling2.jpg
The firewall (iptables, shorewall) is not allowing any traffic to any interface by default. But traffic from "HOST A" to "HOST" and vice verca don't get dropped or rejected by the firewall. What is the best relevant configuration to stop traffic between the sub-networks (.2.0/24, .1.0/24)? And more important, why is the traffic between the sub-networks allowed?
And I repeat: The firewall configuration do NOT allow traffic from zone loc (.1.0/24) and wlan (.2.0/24).
How do I solve this and why is this happening? |
|
Back to top |
|
|
moocha Watchman
Joined: 21 Oct 2003 Posts: 5722
|
Posted: Wed Aug 02, 2006 8:34 pm Post subject: |
|
|
Is your FORWARD chain policy by any chance set to ACCEPT? _________________ Military Commissions Act of 2006: http://tinyurl.com/jrcto
"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety."
-- attributed to Benjamin Franklin |
|
Back to top |
|
|
jrogby n00b
Joined: 02 Aug 2006 Posts: 10
|
Posted: Thu Aug 03, 2006 8:21 am Post subject: |
|
|
Seems like I don't have any FORWARD chain what so ever.. What's the best place to put a rule like this? Is /etc/shorewall/policy the place to put it? And how about the syntax then?
Regards Jonatan |
|
Back to top |
|
|
moocha Watchman
Joined: 21 Oct 2003 Posts: 5722
|
Posted: Thu Aug 03, 2006 9:54 am Post subject: |
|
|
I'm sorry, I'm not actually familiar with shorewall's syntax (I use custom-built rules). To check the chain policy (it's simply not possible that you don't have a FORWARD chain if you have iptables support in the kernel) issue this command (after starting the firewall, of course - also note it is case sensitive): Code: | iptables -L FORWARD | and look at the first line. _________________ Military Commissions Act of 2006: http://tinyurl.com/jrcto
"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety."
-- attributed to Benjamin Franklin |
|
Back to top |
|
|
jrogby n00b
Joined: 02 Aug 2006 Posts: 10
|
Posted: Thu Aug 03, 2006 10:14 am Post subject: |
|
|
moocha wrote: | ...issue this command (after starting the firewall, of course - also note it is case sensitive): Code: | iptables -L FORWARD | and look at the first line. |
root@firewall:/home/memetic# iptables -L FORWARD
Chain FORWARD (policy DROP)
target prot opt source destination
eth0_fwd all -- anywhere anywhere
eth1_fwd all -- anywhere anywhere
eth2_fwd all -- anywhere anywhere
eth3_fwd all -- anywhere anywhere
Reject all -- anywhere anywhere
LOG all -- anywhere anywhere LOG level info prefix `Shorewall:FORWARD:REJECT:'
reject all -- anywhere anywhere
Should not this block traffic between eth1 and eth2 (also eth3)? |
|
Back to top |
|
|
moocha Watchman
Joined: 21 Oct 2003 Posts: 5722
|
Posted: Thu Aug 03, 2006 11:27 am Post subject: |
|
|
Based on what I'm seeing there, I'd say it should not, since it specifies that traffic originating from eth1 gets forwarded to anywhere, etc etc. _________________ Military Commissions Act of 2006: http://tinyurl.com/jrcto
"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety."
-- attributed to Benjamin Franklin |
|
Back to top |
|
|
Katano n00b
Joined: 06 Oct 2005 Posts: 14
|
Posted: Thu Aug 03, 2006 12:55 pm Post subject: |
|
|
hello,
well... it seems that you dont allow forwarding at all.
so am i guessing right that you have an proxy server running that handels the connection to the internet?
maybe that is the weak point in this construction...
because, as moocha already said, iptables should block the traffic...
greetings,
katano |
|
Back to top |
|
|
jrogby n00b
Joined: 02 Aug 2006 Posts: 10
|
Posted: Thu Aug 03, 2006 2:07 pm Post subject: |
|
|
I don't have any advanced network setup (yet ). But since I installed a new NIC on my firewall (Now it's a new machine with new NICs, the old one was big, slow and noicy), I alwas had this problem..
I have for the moment very few PCs connected to the network and I have only ONE acting as a firewall/router (running debian). No modems or other routers is connected (100Mbit ethernet jack in my apartment).
I have two "LAN"-zones, loc and wlan. The problem is that computers from my wlan can access my loc (wired LAN). That should not be possible as it is a big security risk (btw. wlan is protected with WPA and filter it mac-addresses)! But anyway it SHOULD not be possible to connect to the loc zone from wlan zone..
Running IPTABLES w/shorewall on top.
loc 192.168.1.0/24
wlan 192.168.2.0/24 (it's a normal ethernet card connected to an AP (dhcp etc is disabled on the AP)
oooh, should get some sleep... hope you understand what I mean anyway.. |
|
Back to top |
|
|
mno Guru
Joined: 29 Dec 2003 Posts: 454 Location: Toronto, Canada
|
Posted: Thu Aug 03, 2006 2:53 pm Post subject: |
|
|
jrogby wrote: | root@firewall:/home/memetic# iptables -L FORWARD
Chain FORWARD (policy DROP)
target prot opt source destination
eth0_fwd all -- anywhere anywhere
eth1_fwd all -- anywhere anywhere
eth2_fwd all -- anywhere anywhere
eth3_fwd all -- anywhere anywhere
Reject all -- anywhere anywhere
LOG all -- anywhere anywhere LOG level info prefix `Shorewall:FORWARD:REJECT:'
reject all -- anywhere anywhere |
Depending on what 'eth[0..3]_fwd', and assuming they mean the logical things, then you're allowing all forwarding from any of the interfaces to any of the interfaces. If you want to specifically block traffic from eth1 to eth2, you'd need to add a rule like the following somehow in shorewall [never used it, don't know syntax] before the rule (eth1_fwd all -- anywhere anywhere):
reject all -- [ip of eth1] [ip of eth2]
reject all -- [ip of eth2] [ip of eth1] _________________ "Hello and goodbye. As always." | You can't use here?? | Unanswered |
|
Back to top |
|
|
moocha Watchman
Joined: 21 Oct 2003 Posts: 5722
|
Posted: Thu Aug 03, 2006 3:57 pm Post subject: |
|
|
Katano wrote: | hello,
well... it seems that you dont allow forwarding at all.
so am i guessing right that you have an proxy server running that handels the connection to the internet?
maybe that is the weak point in this construction...
because, as moocha already said, iptables should block the traffic...
greetings,
katano | No, actually I said that iptables should NOT block. The chain policy only applies as last resort, i.e. it's the default fallthrough rule should no other rule above it match... He's allowing forwarding from any to any, by the looks of it _________________ Military Commissions Act of 2006: http://tinyurl.com/jrcto
"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety."
-- attributed to Benjamin Franklin |
|
Back to top |
|
|
|