Project

General

Profile

Actions

Feature #447

closed

patch for PPP links with mpd5

Added by Marcus Brown about 14 years ago. Updated over 13 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
PPP Interfaces
Target version:
Start date:
03/24/2010
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
Release Notes:

Description

I have PPP with mpd5 working really well now, including setting the APN and APN Number. Your patched mpd5 (for avoiding NGM_TTY_COOKIE check) in recent snapshots works great.
Still no work on multilink PPP with serial port links.

Right now the code creates the mpd.secret file. I tested it using the set auth password <password> syntax and got errors so I kept the mpd.secret file generation.

And PPP for modems does need the mpd.script file. It's the chat script file for the link establishment, so where do you want it? Right now it has to be in /etc/ppp/mpd.script, and it's copied to /var/etc/. when ppp is first configured. I think a symlink might be better. ??

I also took away the "Dialcmd" field in the PPP setup page (and a couple others) because the script is rather comprehensive and is designed to handle any modem. I just added the APN stuff to it.

I implemented interface renaming and that simplified the new code a lot, so that's nice. Now ppp interfaces start with ppp0 and go up as you add more.

Also, the ppp-linkdown script is an open issue. This patch refers to the script that Ermal wrote in the /usr/local/sbin/ directory, but I couldn't test it b/c my mpd5 binary doesn't pass the DNS servers the same way the newly(and previously) patched binary does(did). Everyone can test when the next snapshots are released with the patches.

And the uptime tracking is still an open issue. I've figured out how to do it, but haven't done anything yet. This patch set is getting big and taking time to manage all the parts so I decided to cut it here and do the uptime stuff in the next round.

I'll do the SIM pin thing too in the next set. I just need a break for a day.

I'm already experiencing much smother conditions with mpd5 for PPP on 3G than I was with userland ppp. It's very nice.

I also thought there might be a worthy use case for implementing a check box for "dial-on-demand" and text field for "idle timeout."


Files

pfsense-utils.inc.patch.txt (1.05 KB) pfsense-utils.inc.patch.txt Marcus Brown, 03/24/2010 08:16 AM
status_interfaces.php.patch.txt (1.5 KB) status_interfaces.php.patch.txt Marcus Brown, 03/24/2010 08:16 AM
interfaces_assign.patch.txt (1.51 KB) interfaces_assign.patch.txt Marcus Brown, 03/24/2010 08:16 AM
interfaces_ppp.php.patch.txt (1.58 KB) interfaces_ppp.php.patch.txt Marcus Brown, 03/24/2010 08:16 AM
interfaces_ppp_edit.php.patch.txt (7.13 KB) interfaces_ppp_edit.php.patch.txt Marcus Brown, 03/24/2010 08:16 AM
interfaces.inc.patch.txt (14 KB) interfaces.inc.patch.txt Marcus Brown, 03/24/2010 08:16 AM
mpd.script (39.3 KB) mpd.script Marcus Brown, 03/24/2010 08:16 AM
mpd.script (39.3 KB) mpd.script Marcus Brown, 03/24/2010 08:28 AM
pfsense-utils.inc.patch.2.txt (2.09 KB) pfsense-utils.inc.patch.2.txt Marcus Brown, 03/24/2010 09:19 AM
ppp0.query.txt (36 Bytes) ppp0.query.txt Marcus Brown, 03/24/2010 09:19 AM
Actions #1

Updated by Marcus Brown about 14 years ago

Here's a better mpd.script file.
G.

Actions #2

Updated by Marcus Brown about 14 years ago

Here's a second pfsense-utils.inc patch. Run previous patch attached to original post first. This implements uptime calculation (but not history).
You also must have a file /var/etc/ppp0.query if ppp0 is the active interface. I'll update interface_ppp_configure to generate the query file tomorrow.
The patches use /usr/bin/nc to query the telnet server at port 5005 for connect time of the link.

Actions #3

Updated by Ermal Luçi about 14 years ago

  • Status changed from New to Feedback
  • Assignee deleted (Core Team)

This has been committed to the repo, though some modification are done on top of it.
Test and report.

Actions #4

Updated by Marcus Brown about 14 years ago

I realized there is one downside to the current scheme of launching a separate mpd instance for every configured interface which is that I believe there is no way to set different console ports for the different intstances of mpd. So at any given time, only one interface will be able to run the console on the default 5005 port and report its uptime. Anyone interested in giving some thought to a single mpd.conf file for all configured mpd interfaces? I've thought about it a little and thought maybe we could write the conf file from the interfaces_assign.php page, and a function in interfaces.inc that wraps all the other *_config functions for mpd and takes care of opening and writing the file. I know it's a departure from the current scheme, but I thought I'd mention it for discussion.

Actions #5

Updated by Marcus Brown about 14 years ago

Ha!. Never mind. It's trivial to set a different console port for different instances of mpd. Right now, if users add more than one PPP link, only one will be able to run the console (and report uptime) b/c the port setting is not dynamic.

Actions #6

Updated by Ermal Luçi about 14 years ago

  • % Done changed from 90 to 100

Should be ok now.

The only thing i am not understanding is in ppp_accumulated_time where do you write this file?

Actions #7

Updated by Marcus Brown about 14 years ago

Yes, that is the one thing I didn't do yet, and I'm not sure how to do it either. I spent about 20 minutes testing different ways to make the ppp-linkdown script call the nc command to get the total session time, but it wasn't working. I suspect that the "session Time" in mpd5 is unavailable by the time the link-down script is called. I'm not sure what is happening or how to fix it. . . . ? Is it feasible to patch mpd5 to send the total session seconds as a variable that gets sent to the linkdown script?

Actions #8

Updated by Ermal Luçi over 13 years ago

  • Status changed from Feedback to Resolved
Actions

Also available in: Atom PDF