Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
routing problems
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
jonnymalm
n00b
n00b


Joined: 26 Jun 2002
Posts: 68

PostPosted: Mon Dec 29, 2003 3:44 pm    Post subject: routing problems Reply with quote

I am setting up a gentoo box to be a router:
Code:
cable modem --> eth0(dhcp) [gentoo box] eth1(192.168.2.1) -- > wan iface(192.168.2.2) [linksys router]lan iface(192.168..1.1) --> interenal lan 192.168.1.*


I have to use the linksys for wireless access and also I do not have a hub/switch so I need it to connect my other computers. I basically am doing this for educational/security purposes.(I know it is redundant to NAT twice)

I am having troubles connecting to the Internet from my lan. Here is my routing table:
Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.2.0     *               255.255.255.0   U     0      0        0 eth1
X.X.5.0         *               255.255.255.0   U     0      0        0 eth0
loopback        localhost       255.0.0.0       UG    0      0        0 lo
default         X.X.5.1         0.0.0.0         UG    1      0        0 eth0


I also do a:
Code:
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE


Now from the internal lan I can ping 192.168.2.1 but I cannot ping the other ip address on eth0 or any other ip on the Internet. I have done this before but for some reason it is not working and I know I am forgetting to do something stupid.

Any ideas?
Back to top
View user's profile Send private message
think4urs11
Bodhisattva
Bodhisattva


Joined: 25 Jun 2003
Posts: 6659
Location: above the cloud

PostPosted: Mon Dec 29, 2003 3:48 pm    Post subject: Reply with quote

Did you set the default gateway on your linksys to be 192.168.2.1?
_________________
Nothing is secure / Security is always a trade-off with usability / Do not assume anything / Trust no-one, nothing / Paranoia is your friend / Think for yourself
Back to top
View user's profile Send private message
jonnymalm
n00b
n00b


Joined: 26 Jun 2002
Posts: 68

PostPosted: Mon Dec 29, 2003 3:51 pm    Post subject: Reply with quote

Quote:
Did you set the default gateway on your linksys to be 192.168.2.1?

Yes, the linksys' default gateway is set to 192.168.2.1. I have done a
Code:
tcpdump -i eth0
tcpdump -i eth1

Traffic seems to get to eth1 but not to eth0
Back to top
View user's profile Send private message
think4urs11
Bodhisattva
Bodhisattva


Joined: 25 Jun 2003
Posts: 6659
Location: above the cloud

PostPosted: Mon Dec 29, 2003 3:54 pm    Post subject: Reply with quote

you need a routing entry on the gentoo box for 192.168.1.0/24 via 192.168.2.2

HTH
T.
_________________
Nothing is secure / Security is always a trade-off with usability / Do not assume anything / Trust no-one, nothing / Paranoia is your friend / Think for yourself
Back to top
View user's profile Send private message
jonnymalm
n00b
n00b


Joined: 26 Jun 2002
Posts: 68

PostPosted: Mon Dec 29, 2003 4:00 pm    Post subject: Reply with quote

ahh, good point. I will give that a go tonight. I knew it was something glaringly obvious and I would hit myself when I saw it. Thx Think4UrS11!
Back to top
View user's profile Send private message
think4urs11
Bodhisattva
Bodhisattva


Joined: 25 Jun 2003
Posts: 6659
Location: above the cloud

PostPosted: Mon Dec 29, 2003 4:19 pm    Post subject: Reply with quote

don't hit yourself too hard please :roll:
the smaller the bug, the bigger the time loss due to it, some would call this murphys law...

PLUS... you are not alone in bugland 8)
_________________
Nothing is secure / Security is always a trade-off with usability / Do not assume anything / Trust no-one, nothing / Paranoia is your friend / Think for yourself
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