[wplug] multi network IF, want to pick address

Rick Smith rick at rbsmith.com
Sat Mar 10 01:44:31 EST 2001


Thanks to pointers received, I did a hack-it solution.
Pretty ugly.. and it works.  It adds a line to the end
of my /etc/hosts which is:  "{PPP ip address} <tab> autopppip"
The dummy entry meets the need of whatever in mail to map ip to name,
and mail goes out without waiting for timeout.

  #/bin/sh
  # Remove old
  grep -v autopppip /etc/hosts > /etc/hosts.new
  # Add new: IP <tab> autopppip
  ifconfig | sed -n 's/.*inet addr:\([^ ]*\) *P-t-P.*/\1  autopppip/p' \
        >> /etc/hosts.new \
        && mv /etc/hosts /etc/hosts.old \
        && mv /etc/hosts.new /etc/hosts

-- Rick


On Fri, Mar 09, 2001 at 08:04:16PM -0500, Rick Smith wrote:
> Hi,
> 
> I'm connected to 2 networks: thru ppp0 and eth0.
> The eth0 is my default route: my connection to the general internet,
> DNS and my mail server.
> 
> When I try to use sendmail, it hangs up, wanting to resolve my address,
> for which it uses the ppp0, which it seems to be thinking is my address:
>   Mar  9 19:57:55 sharp sendmail[21905]: gethostbyaddr failed: 2
> 
> I'm wanting my address to be the address of eth0.  I've played around
> with ifconfig and route and haven't hit on the magic incantation.  As
> I will go read more man pages and sendmail books and things like that,
> I'm hoping someone might understand what is going on and point me in
> the right direction.
> 
> Does this make sense?
> 
> Rick



More information about the wplug mailing list