I was contacted off line about this and it was suggested that I
post my solution/workaround to the list. The request actually was
for the post to be to the ppp list but I spend most my list time on the
redhat-list so I am sending it to both.
This is running on a 6.2 installation.
I decided not to break the redhat ppp-watch thing in the hope that future
upgrades will go ok.
I should probably delete the echo to /proc/.../ip_forward
and use the sysctl.conf but have not had time to think it through and give
it a try
after all its working now so why fix it :)
I added a call in rc.local to a script I named rc.pppdemand
rc.pppdemand looks like this:
----------------------------------------------------
#!/bin/sh
#/etc/rc.d/rc.pppdemand
#This script is designed for demand dial ppp to work around the pppwatch
#program that RedHat uses in later versions (6.2 for sure.) I call it from
rc.local.
#This will bring up ppp0, ping the link to bring it up, set a route to the
#host that the
#remote variable is set to, and set ip-forwarding on. A few messages are
put
#in the log
# to leave a trail of some idea of what is happening
#All that needs to be done is set the remote variable in the script to the
#machine you are dialing into
#and change the network in the route command to fit. If you are letting ppp
#set a default route just comment out the route related commands
#Feel free to use it and modify it to your hearts content. If you pass it
on
#at least give me
#some of the credit or blame. Bret Hughes - [EMAIL PROTECTED]
#change this for your configuration
remote="hostname.of.remote.computer"
logger "$0 Starting ppp0 with ifup ppp0"
#this is launched in the background because it will not return until the
link
#is brought up by a packet needing to use the link.
nohup ifup ppp0 &
sleep 3
logger "$0 Pinging $remote to setup interface host route"
ping -c1 $remote
logger "$0 adding network route for $remote"
#change network for your configuration
route add -net 192.168.1.0 netmask 255.255.255.0 gw $remote
logger "$0 route addition completed with return code = $?"
logger "$0 setting ip forwarding on"
echo 1 > /proc/sys/net/ipv4/ip_forward
--------------------------------------------------------------------
As you can tell, I don't use this to dial an isp but it should work for it.
You will probably not need the route addition since you probably have ppp
doing the default route deal.
you can bring the link up by calling rc.pppdemand. I never bring it down
but
what ever works for killing ppp should do it.
kill `pidof pppd` would probably work.
Let me know if this helps or if I can be of further assistance.
Bret
Bret Hughes wrote:
> I've been working for the better part of two days (I am a little ashamed
> to admit) on gettting a redhat 6.2 dial on demand thing working and all
> the associated routing stuff working. This is not your normal default
> route to the internet type of deal, but that is beside the point I am
> asking about here. I have pppd working in demand mode with all the
> stuff I need but I am having problems understanding what is happening
> when I try to do:
>
> ifup ppp0
>
> the process rocks along until the exec ppp-watch in
> /etc/sysconfig/network-scripts/ifup-ppp. At this point the thing just
> hangs until the first packet arrives that needs the interface to be up
> and pppd dials.
>
> I think I would like to interface with the redhat scripts cleanly so I
> won't get bitten by an upgrade later on but maybye I should just roll my
> own script. and dump it into rc.local which is where I was going to put
> the ifup ppp0 command anyway.
>
> The exec is in an if statement :
> if [ "$1" != daemon ] ; then
> # just in case a full path to the configuration file is passed in
> ifcfg=$(basename $1)
> shift
> echo " in if \$1 != daemon \$@ = $@" #this is mine to
> track how far I was getting
> # let ppp-watch do the right thing
> exec /sbin/ppp-watch "$ifcfg" "$@"
> fi
>
> I can run ifup-ppp daemon ifcfg-ppp0 and get the connection to work but
> end up with the thing running in my shell.
>
> Should I just nohup it with & at the end and be done with it?
>
> Here is the /etc/ppp options:
> lock
> demand
> idle 20
>
> here is network-scripts/ifcfg-ppp0:
>
> DEVICE="ppp0"
> ONBOOT="no"
> USERCTL="no"
> PEERDNS="yes"
> MODEMPORT="/dev/modem"
> LINESPEED="115200"
> PERSIST="yes"
> DEFABORT="yes"
> DEBUG="yes"
> INITSTRING="AT S7=45 S0=0 L1 V1 X2 &c1 E1 Q0"
> DEFROUTE="no"
> HARDFLOWCTL="yes"
> ESCAPECHARS="no"
> PPPOPTIONS="demand"
> PAPNAME="mainoffice"
> REMIP="192.168.1.254"
> NETMASK=""
> IPADDR="192.168.0.3"
> MRU=""
> MTU=""
> DISCONNECTTIMEOUT=""
> RETRYTIMEOUT="5"
> BOOTPROTO="none"
>
> Any and all help appreciated.
>
> Bret
>
> --
> To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
> as the Subject.
--
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.