[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Strange ARP problem with a PPP link



Hello!

________________
 Brief Summary:
----------------
  Strange problem in setting up ARP table for a small network connected
  via dial-up PPP to my linux server. It's necessary for me to
  issue the /sbin/arp command *twice*, isn't it strange?

__________________
 Long Description:
------------------

I've a Linux server running kernel 1.2.13, pppd 2.2.0 which regularly
receives incoming calls for single-host PPP connections. Its IP address
is 151.99.137.2 and is permanently connected to the Net.

I need to connect a small network of a maximum of 6 PC through a modem
via dial-up line using PPP. The remote machine (which serves as
a gateway for the remote network) is a Debian Linux box, kernel 1.2.13
pppd 2.2.0. 

I've subnetted my own network 151.99.137.0, reserving the last 8
addresses for the remote network (151.99.137.248 - 255 ). 
To the calling Linux machine I've assinged the address 151.99.137.107
and then I configure the arp and the route table with the
/etc/ppp/ip-up script, in this way:

---------------------< /etc/ppp/ip-up >-----------------------------
#!/bin/bash
OUT=/tmp/ip-up.log
ROUTE=/sbin/route
ARP=/sbin/arp

# Our Ethernet Adress 
ETH_ADDR=00:40:33:2D:FE:04
# IP address of remote
PR_IP=151.99.137.107

# Log something

echo --------- ip-up started on `date` by `id` >> $OUT

echo interface-name: $1 >> $OUT
echo tty-device: $2 >> $OUT
echo speed: $3 >> $OUT
echo local-IP-address: $4 >> $OUT
echo remote-IP-address: $5 >> $OUT

if [ "$5" = "$PR_IP" ]

then
    echo PR detected... configuring arp table and routing >> $OUT

    # ARP of the remote network
    $ARP -s 151.99.137.248 $ETH_ADDR netmask 255.255.255.248 pub

    # Add routing
    $ROUTE add -net 151.99.137.248 netmask 255.255.255.248 dev $1

    # Log results:
    echo ifconfig: >> $OUT
    /sbin/ifconfig $1 >> $OUT
    echo "" >> $OUT
    echo ARP Table: >> $OUT
    cat /proc/net/arp >> $OUT
    echo "" >> $OUT
    echo Routing table: >> $OUT
    /sbin/route >> $OUT
fi

# else nothing to do
exit 0
--------------------------------------------------------------------

The Point-to-Point link between my server and the remote linux box works
fine, no problems at all. 

After the connection has been established and the ppp0 interface is
up, the log reports this configuration:

 - ifconfig ppp0
ppp0      Link encap:Point-Point Protocol
          inet addr:151.99.137.2  P-t-P:151.99.137.107  Mask:255.255.255.0
          UP POINTOPOINT RUNNING  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0
          TX packets:0 errors:0 dropped:0 overruns:0

 - ARP Table:
IP address       HW type     Flags       HW address            Mask
151.99.137.1     0x1         0x2         00:00:0C:3B:AF:AB     *
151.99.137.248   0x1         0x2e        00:40:33:2D:FE:04     255.255.255.248
151.99.137.107   0x1         0xe         00:40:33:2D:FE:04     *

 - Kernel routing table
Destination     Gateway         Genmask         Flags MSS    Window Use Iface
151.99.137.107  *               255.255.255.255 UH    1436   0        1 ppp0
151.99.137.248  *               255.255.255.248 U     1436   0        0 ppp0
localnet        *               255.255.255.0   U     1436   0     1353 eth0
loopback        *               255.0.0.0       U     1936   0     5122 lo
default         PUBLInet-gw     *               UG    1436   0    13791 eth0


_________________
 The PROBLEM
-----------------

The problem is this: altough the arp and the routing table are set
correctly, the PCs on the remote network aren't reachable, the only
way to make them reachable is to set *AGAIN* and *BY HAND* the
arp command, then the link works as it should, i.e.:

    /sbin/arp -s 151.99.137.248 $ETH_ADDR netmask 255.255.255.248 pub

Why this happens? Why I need to issue the arp command twice?

Thanks in advance for any answers (please respond via e-mail).

Best regards,

   Luca.



Reply to: