Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gateway through iptables (shorewall)
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
Deathwing00
Bodhisattva
Bodhisattva


Joined: 13 Jun 2003
Posts: 4087
Location: Dresden, Germany

PostPosted: Sat Jun 21, 2003 2:11 pm    Post subject: Gateway through iptables (shorewall) Reply with quote

I want my desktop computer to serve as gateway to my laptop. I have 2 ethernet cards on my desktop computer (eth0: LAN and eth1: NET). I have managed to configure iptables with shorewall so my desktop PC assigns a dynamic IP to the laptop (DHCP) and it works.
The PROBLEM is that if I don't ping the laptop, the access of the laptop to the net doesn't work. I'd like to know if there is a reason for this and how I can solve it. Also, after certain period of innactivity, I mean that the laptop stops using internet for a while, then when I try to make a connection, the desktop pc doesn't respond to it. It's a very strange behaviour... is anyone so intelligent to help me with this?
Back to top
View user's profile Send private message
devon
l33t
l33t


Joined: 23 Jun 2003
Posts: 943

PostPosted: Mon Jun 23, 2003 10:49 pm    Post subject: ARP Problem? Reply with quote

Don't know if anyone has helped you with this. :(

What I think may be happening is an ARP problem. When you ping the laptop, the gateway makes an entry in it's ARP table for the laptop's hardware address. After a certain amount of inactivity, that entry expires. Now why doesn't the inital packets from the laptop to the gateway make that ARP entry? I have never used Shorewall, but perhaps the settings are a little strict (regarding Ethernet frames)?

To see if what I suspect is happening, you can do the following:

1. Wait till the laptop stops working.
2. Do a "/sbin/arp -n" on the gateway.
3. You should not see an entry for your laptop (look for the IP address you assigned it).
4. Ping from the gateway to the laptop.
5. You should now see an entry.
6. Wash, rinse, repeat.

Sample "/sbin/arp -n" output

Code:

$ /sbin/arp -n
Address                  HWtype  HWaddress           Flags Mask            Iface
192.168.2.254            ether   00:04:AC:E3:9B:88   C                     eth0
192.168.2.11             ether   00:06:29:29:37:8F   C                     eth0
192.168.2.205            ether   00:06:29:39:CE:5D   C                     eth0


Another solution (assuming that Shorewall is okay), is to make a static arp entry on the server. "man arp" for more information.
Back to top
View user's profile Send private message
Deathwing00
Bodhisattva
Bodhisattva


Joined: 13 Jun 2003
Posts: 4087
Location: Dresden, Germany

PostPosted: Mon Jun 23, 2003 10:59 pm    Post subject: Reply with quote

Sorry! I already solved the problem by myself and forgot to post it here!!! :oops: Just followed the Installation docs (route add -net default gw xx.xx.xx.xx netmask 0.0.0.0 metric 1 eth0)
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