Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Routing between two private subnets
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
jrogby
n00b
n00b


Joined: 02 Aug 2006
Posts: 10

PostPosted: Wed Aug 02, 2006 1:43 pm    Post subject: Routing between two private subnets Reply with quote

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
View user's profile Send private message
moocha
Watchman
Watchman


Joined: 21 Oct 2003
Posts: 5722

PostPosted: Wed Aug 02, 2006 8:34 pm    Post subject: Reply with quote

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
View user's profile Send private message
jrogby
n00b
n00b


Joined: 02 Aug 2006
Posts: 10

PostPosted: Thu Aug 03, 2006 8:21 am    Post subject: Reply with quote

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
View user's profile Send private message
moocha
Watchman
Watchman


Joined: 21 Oct 2003
Posts: 5722

PostPosted: Thu Aug 03, 2006 9:54 am    Post subject: Reply with quote

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
View user's profile Send private message
jrogby
n00b
n00b


Joined: 02 Aug 2006
Posts: 10

PostPosted: Thu Aug 03, 2006 10:14 am    Post subject: Reply with quote

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
View user's profile Send private message
moocha
Watchman
Watchman


Joined: 21 Oct 2003
Posts: 5722

PostPosted: Thu Aug 03, 2006 11:27 am    Post subject: Reply with quote

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
View user's profile Send private message
Katano
n00b
n00b


Joined: 06 Oct 2005
Posts: 14

PostPosted: Thu Aug 03, 2006 12:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
jrogby
n00b
n00b


Joined: 02 Aug 2006
Posts: 10

PostPosted: Thu Aug 03, 2006 2:07 pm    Post subject: Reply with quote

I don't have any advanced network setup (yet :lol: ). 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
View user's profile Send private message
mno
Guru
Guru


Joined: 29 Dec 2003
Posts: 454
Location: Toronto, Canada

PostPosted: Thu Aug 03, 2006 2:53 pm    Post subject: Reply with quote

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
View user's profile Send private message
moocha
Watchman
Watchman


Joined: 21 Oct 2003
Posts: 5722

PostPosted: Thu Aug 03, 2006 3:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum