Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
10-12-2002, 06:57 PM
|
#1
|
LQ Newbie
Registered: Feb 2001
Location: London
Distribution: Red Hat Linux 9.0
Posts: 23
Rep:
|
Automate PPPD
Hi
I have setup a dial up connection to my ISP and all the associated DNS etc. I used the Network Configuration Tool under Red Hat 7.3 to get everything working with the ppp daemon and all is well apart from one thing.
If I start the ppp with a script /etc/sysconfig/network-scripts/ifup ppp0 (logged on as a simple user and putting the process into the background) everything is fine BUT if I use the Network Configuration Tool (for which I have to give the root password) the tool locks up although the pppd starts (I checked the log and used the connection).
This won't be a problem but when I set PPP to start on boot as well as on demand, so that it will always be there when the box starts, the box stopped during the boot sequence saying - starting the PPP daemon - the same behaviour as the Configuration Tool. (I got back into the box by booting to level 1 and using vi to change the setting on ppp0 back.)
I want the damon to start but stay in the background until need - anyone got any ideas?
Thanks
Ash
|
|
|
10-12-2002, 10:03 PM
|
#2
|
LQ Guru
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163
Rep:
|
something is setup wrong most likely in the config file.
It should bootup and not connect, then if you look at ifconfig it shows an interface on ppp0 but it will not be connected. When traffic is sent to the interface it dials and reconfigures the interface.
|
|
|
10-13-2002, 10:20 AM
|
#3
|
LQ Newbie
Registered: Feb 2001
Location: London
Distribution: Red Hat Linux 9.0
Posts: 23
Original Poster
Rep:
|
Hi
Thanks for that - do you mean the config file for PPP0?
Thanks
ash
|
|
|
10-13-2002, 03:03 PM
|
#4
|
LQ Guru
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163
Rep:
|
yes,
if you use a file like options.demand you would use this command
pppd file /etc/ppp/options.demand
the file options.demand will be like your options file but contain demand and the ip address
like this
demand
0.0.0.0:10.10.10.10
connect "/usr/sbin/chat -v -f /etc/ppp/yourconnectscript"
or your connection script could be in your home folder
then use connect "/usr/sbin/chat -v -f ~/.myisp1
or whatever
the script has the phone number to dial and other parameters
see man pppd
man chat for more options
what this will do is create the ppp0 interface but not do the connect untill there is traffic on the ppp0 interface
as soon as you get traffic on the interface it will run the script
|
|
|
10-14-2002, 03:09 AM
|
#5
|
LQ Newbie
Registered: Feb 2001
Location: London
Distribution: Red Hat Linux 9.0
Posts: 23
Original Poster
Rep:
|
Hi
ok - I will try that out. I won't be able to get to the box for a few days but I will let you know how I get on. I have seen the options file.
BTW: I did manage to make everything connect - its just the boot sequence and starting from Control Panel. Would the above not setup still allow connection via the ifup?
Thanks again
Ash
|
|
|
10-14-2002, 11:40 AM
|
#6
|
LQ Guru
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163
Rep:
|
it should if you just modify the /etc/ppp/options file. It will use that file by default
|
|
|
10-20-2002, 11:55 AM
|
#7
|
LQ Newbie
Registered: Feb 2001
Location: London
Distribution: Red Hat Linux 9.0
Posts: 23
Original Poster
Rep:
|
Hi
Ok - I did some more digging and have found that
1) Although there are scripts in /etc/ppp including the options file (which is configured) they are not being used.
2) When I run as root services network restart the ppp information is all coming from the folder /etc/sysconfig/network-scripts. In the folder there is the command ifup which is being called by the init.d network scripts to start the interface ppp0 at boot time.
In the network scripts directory we have a file ifcfg-ppp0 which has the details of the connection to make including the WVDIAL section that is to be used. There is a section in there for PPPOPTIONS this has the word demand and the dummy ip addresses along with the commands to allow override when connection occurs.
Did I tell you I am using red hat 7.3?
When as root I restart the network service and the ifcfg-ppp0 file has the line ONBOOT='yes' everything is fine until the daemon starts ppp - at which point it waits until there is data actually going across the link before the script for the daemon carries on. I need it to start ifup in the background NOT wait. This error is what has been stopping the boot - its waiting for data on the link before proceeding but I can't do that until it finished the boot and I start KDE and open Konquorer.
I need the services network restart to complete without data moving across the link. This will give me confidence that the boot will work too.
I am puzzled as to why its not using the ppp-o* scripts in /etc/ppp (I configured them but its taking no notice)
Can anyone help here?
Thanks
Ash

|
|
|
10-20-2002, 07:51 PM
|
#8
|
LQ Guru
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163
Rep:
|
I think it would be best to put ONBOOT=no in the ifcfg-ppp0 file and use pppd from another script. that way you can specify the files to use or simply use a single command to start pppd.
Last edited by DavidPhillips; 10-20-2002 at 07:53 PM.
|
|
|
10-20-2002, 07:59 PM
|
#9
|
LQ Guru
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163
Rep:
|
the main reason I say this is because they are using wvdial
wvdial is not configurable. It just connects using the scripts it has. whereas pppd is still used in the end. why not just use pppd and chat directly and you can have it us files like ~/pppoptions which would be in a users home folder and they could put the phone number they need in it.
|
|
|
10-21-2002, 02:49 AM
|
#10
|
LQ Newbie
Registered: Feb 2001
Location: London
Distribution: Red Hat Linux 9.0
Posts: 23
Original Poster
Rep:
|
Hi
Sounds good - which script is recommended. I need something that will run as the box comes up.
Ash
|
|
|
10-22-2002, 06:58 PM
|
#11
|
LQ Guru
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163
Rep:
|
add this command to /etc/rc.d/rc.local
/usr/sbin/pppd file /etc/ppp/options.demand
and setup the interface for ONBOOT=no in ifcfg-ppp0
Last edited by DavidPhillips; 10-22-2002 at 07:01 PM.
|
|
|
10-22-2002, 07:30 PM
|
#12
|
Senior Member
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458
Rep:
|
What I found with my connections was that pppd never sent anything back to say it had completed it's task,
at least until the first successful connection.
Having it in the boot sequence meant everything hung waiting for it to provide an exit code, which never came.
I had the same experience with rc.local...
Now I just call it from cron every 8 mins and test for a pid. If no pid, then start, if a pid exists, kill the script.
I found several examples of that script inside the rc.d files.
Another observation,
the first packet that starts the connection never gets a connection.
It takes a 2nd attempt to be routed correctly.
pppd adds a dummy ip number to the routing table, which is replaced by a correct dhcp allocation after the dialling has completed.
Subsequent packets are correctly routed then.
Do you get this behaviour too?
Regards,
Peter
Last edited by peter_robb; 10-22-2002 at 07:32 PM.
|
|
|
10-27-2002, 08:13 AM
|
#13
|
LQ Guru
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163
Rep:
|
I just open a browser and it connects
The first packet would goto the dummy so I guess it gets lost. Not sure if it's supposed to resend it. I doubt it since it is starting the connect script and was routed to a dummy ip.
so did you get it to work yet?
I am going to go ahead and post some files I have
root@micro:~# cat /etc/ppp/options.demand
# General configuration options for PPPD:
lock
defaultroute
noipdefault
modem
/dev/ttyS2
230400
crtscts
# Uncomment the line below for more verbose error reporting:
#debug
# If you have a default route already, pppd may require the other side
# to authenticate itself, which most ISPs will not do. To work around this,
# uncomment the line below. Note that this may have negative side effects
# on system security if you allow PPP dialins. See the docs in /usr/doc/ppp*
# for more information.
#noauth
passive
asyncmap 0
name "dphillips"
ipcp-accept-local
ipcp-accept-remote
0.0.0.0:10.10.10.10
demand
connect "/usr/sbin/chat -v -f /etc/ppp/pppscript"
root@micro:~# cat /etc/ppp/pppscript
TIMEOUT 60
ABORT ERROR
ABORT BUSY
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
"" "AT&FH0"
OK "atdt9,7772000"
TIMEOUT 75
CONNECT
and I have the pap-secrets file with the user and password
that's all I need for it to work
pppd file /etc/ppp/options.demand
|
|
|
10-27-2002, 09:12 AM
|
#14
|
LQ Newbie
Registered: Feb 2001
Location: London
Distribution: Red Hat Linux 9.0
Posts: 23
Original Poster
Rep:
|
Hi
I have been away for a couple of days but the behaviour is exactly as you describe - it connects ok second attemp. I will check out the files and come back to you. (But I only get to work on this weekends!)
Thanks for all the help - its appreciated
ash
|
|
|
10-27-2002, 10:29 AM
|
#15
|
LQ Newbie
Registered: Feb 2001
Location: London
Distribution: Red Hat Linux 9.0
Posts: 23
Original Poster
Rep:
|
It works! This message is sent using the technique described by David Phillips. I am off to see if I can get the box to bring the interface up to ready a boot time. How do I set the time out of the connection - ie if not used for so long then put the phone down?
Thanks a lot. I have been searching for this info for a long time - could it/is it part of an FAQ somewhere?
Ash
|
|
|
All times are GMT -5. The time now is 09:16 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|