netdev
[Top] [All Lists]

Re: netfilter NAT vs. pump

To: andrewm@xxxxxxxxxx (Andrew Morton)
Subject: Re: netfilter NAT vs. pump
From: Werner Almesberger <almesber@xxxxxxxxxxx>
Date: Thu, 15 Jun 2000 07:01:25 +0200 (MET DST)
Cc: netdev@xxxxxxxxxxx, h.verhagen@xxxxxxxxx
In-reply-to: <394818FD.70258D1B@xxxxxxxxxx> from "Andrew Morton" at Jun 14, 2000 11:45:01 PM
Sender: owner-netdev@xxxxxxxxxxx
Andrew Morton wrote:
> I forwarded your patch along and it fixed the problem.  He's using
> pump-0.7.9-1.

Good ! :-) Actually, the further discussion in netdev convinced me that
pump is broken by design and probably not worth fixing, given the
availability of equivalent correct implementations. My /sbin/pump is now:

---------------------------------- cut here -----------------------------------

#!/bin/sh
opt=-R
do=exec

itf=
host=
remove=false

while [ ! -z "$*" ]; do
    case "$1" in
        -i) shift
            itf=$1;;
        -h) shift
            host="-h $1";;
        -r) remove=true;;
        *)  echo "Unrecognized option $1" 1>&2
            exit 1;;
    esac
    shift
done
if $remove; then
#    $do /sbin/dhcpcd $opt -k $itf
    killall -TERM dhcpcd
else
    $do /sbin/dhcpcd $opt $host $itf
fi

---------------------------------- cut here -----------------------------------

Differences to the "real" pump:
 - doesn't know about config files
 - only supports the options used by the RH 6.2 ifup/ifdown scripts
 - change the opt= line if you want it to update /etc/resolv.conf
 - change the remove action (if $remove; then ...) if you want it to
   release the IP address on interface shutdown (I want to keep mine)

Other people have suggested to use dhclient, which seems to do the
right thing too.

- Werner

-- 
  _________________________________________________________________________
 / Werner Almesberger, ICA, EPFL, CH       werner.almesberger@xxxxxxxxxxx /
/_IN_N_032__Tel_+41_21_693_6621__Fax_+41_21_693_6610_____________________/

<Prev in Thread] Current Thread [Next in Thread>