Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved thanks to Hu and Mokia] Simple routing question.
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
ispano
n00b
n00b


Joined: 18 Jul 2010
Posts: 13

PostPosted: Sun Jul 18, 2010 8:31 pm    Post subject: Reply with quote

And seeing as the command you posted last bypasses the rule for that ip, I think I'll use that.
Back to top
View user's profile Send private message
mokia
n00b
n00b


Joined: 01 Feb 2010
Posts: 63
Location: Hungary

PostPosted: Sun Jul 18, 2010 8:34 pm    Post subject: Reply with quote

use this:
-I FORWARD -d 192.168.100.1/32 -i eth1 -j ACCEPT
It allows the modem connection. But dint open your hole internal network for crackers.

Afther this rule
iptables-save looks like this:

# Generated by iptables-save v1.4.6 on Sun Jul 18 07:03:12 2010
*filter
:FORWARD DROP [0:0]
-A FORWARD -d 192.168.100.1/32 -i eth1 -j ACCEPT <-this must be on on top
-A FORWARD -d 192.168.0.0/16 -i eth1 -j DROP
-A FORWARD -s 192.168.0.0/16 -i eth1 -j ACCEPT
-A FORWARD -d 192.168.0.0/16 -i eth0 -j ACCEPT
COMMIT
# Completed on Sun Jul 18 07:03:12 2010

EDIT
Sorry for the forward
Back to top
View user's profile Send private message
ispano
n00b
n00b


Joined: 18 Jul 2010
Posts: 13

PostPosted: Sun Jul 18, 2010 8:38 pm    Post subject: Reply with quote

Yeah I did use it, and it works fine. Looked at it after temporarily disabling "-A FORWARD -d 192.168.0.0/16 -i eth1 -j DROP" and it clicked what it did, so I re-enabled "-A FORWARD -d 192.168.0.0/16 -i eth1 -j DROP" and used your command.

Looks like this now:
-A FORWARD -d 192.168.100.1/32 -i eth1 -j ACCEPT
-A FORWARD -d 192.168.0.0/16 -i eth1 -j DROP
-A FORWARD -s 192.168.0.0/16 -i eth1 -j ACCEPT
-A FORWARD -d 192.168.0.0/16 -i eth0 -j ACCEPT
COMMIT
# Completed on Sun Jul 18 08:37:37 2010

I learn something new everyday with Gentoo, always a good thing.

Thanks again.
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23093

PostPosted: Sun Jul 18, 2010 10:00 pm    Post subject: Reply with quote

Normally, you would use that rule. Normally, it would work fine. Unfortunately, someone had the bright idea of putting an RFC1918 reserved address on a device designed to be on the Internet side of your router.
Back to top
View user's profile Send private message
mokia
n00b
n00b


Joined: 01 Feb 2010
Posts: 63
Location: Hungary

PostPosted: Mon Jul 19, 2010 5:13 am    Post subject: Reply with quote

I think this is the solution, for the RFC standard problem:
-I FORWARD -s 10.0.1.1/32 -i eth0 -j DROP
-I FORWARD -d 10.0.1.1/32 -i eth0 -j DROP
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
Goto page Previous  1, 2
Page 2 of 2

 
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