patch for PPP links with mpd5
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."
#2 Updated by Marcus Brown about 9 years ago
- File pfsense-utils.inc.patch.2.txt pfsense-utils.inc.patch.2.txt added
- File ppp0.query.txt ppp0.query.txt added
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.
#4 Updated by Marcus Brown about 9 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.
#7 Updated by Marcus Brown about 9 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?