View previous topic :: View next topic |
Author |
Message |
Deathwing00 Bodhisattva


Joined: 13 Jun 2003 Posts: 4087 Location: Dresden, Germany
|
Posted: Sat Jun 21, 2003 2:11 pm Post subject: Gateway through iptables (shorewall) |
|
|
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 |
|
 |
devon l33t

Joined: 23 Jun 2003 Posts: 943
|
Posted: Mon Jun 23, 2003 10:49 pm Post subject: ARP Problem? |
|
|
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 |
|
 |
Deathwing00 Bodhisattva


Joined: 13 Jun 2003 Posts: 4087 Location: Dresden, Germany
|
Posted: Mon Jun 23, 2003 10:59 pm Post subject: |
|
|
Sorry! I already solved the problem by myself and forgot to post it here!!! 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 |
|
 |
|
|
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
|
|