Help with user-ppp, ppp.linkup and configuring an additional address block on tunnel

I may just be reading the wrong FM, but I've tried the man page, Handbook, a ppp.conf.sample from elsewhere, and all sorts of Google searches (which produce multiple wrong answers), and this topic just doesn't seem to be covered anywhere. I may be missing something obvious due to terminology!

I'm using user-ppp (just the normal base system ppp, the Brian Somers one, PPP Version 3.4.2) to create a PPPoE tunnel. It works fine. LCP gives the config stuff as required, and a bit of tweaking to ppp.conf and it adds it to the routing table and so on.

My problem is that there's a /29 available on the tunnel. How do I add the aliases?
From the command line the following works (assume /29 is 1.2.3.0/29 and remote (i.e. HISADDR) is 9.9.9.9:

ifconfig wan0 alias 1.2.3.1/32 9.9.9.9
ifconfig wan0 alias 1.2.3.2/32 9.9.9.9
....
(NB. the position of "alias" isn't critical).

It would be better to set this automatically in /etc/ppp/ppp.linkup, and documentations suggests this, but doesn't say how. I've read various ideas that don't work.

add 1.2.3.1/32 - nope, this creates a route!
alias 1.2.3.1 - nope, creates a "deprecated" warning and doesn't appear to do anything.
! ifconfig wan0 alias 1.2.3.1/32 HISADDR - (and variations, with ! or not) all lead to error message in log.

I've also tried the above in ppp.conf itself, no dice. Incidentally, HISADDR isn't static but all other IP addresses involved are. I am NOT using ppp's built in NAT (pf for that kind of thing).

If anyone knows the answer I'd appreciate it, and I'd also appreciate a pointer to the documentation that covers this.
 
I can't provide an exact solution to your question, but I can provide a possible direction. Put your commands into shell script:
Code:
#/bin/sh

/sbin/ifconfig $1 alias 1.2.3.1/32 $2
/sbin/ifconfig $1 alias 1.2.3.2/32 $2
and run it from /etc/ppp/ppp.linkup:
Code:
your-ppp-label:
 !bg /bin/sh /path/to-your/script.sh INTERFACE HISADDR
 
I can't provide an exact solution to your question, but I can provide a possible direction. Put your commands into shell script:
Code:
#/bin/sh

/sbin/ifconfig $1 alias 1.2.3.1/32 $2
/sbin/ifconfig $1 alias 1.2.3.2/32 $2
and run it from /etc/ppp/ppp.linkup:
Code:
your-ppp-label:
 !bg /bin/sh /path/to-your/script.sh INTERFACE HISADDR
That was actually one of the answers Grok generated but "! echo I'm here" in there was an error. I don't think running it in background would improve that. If it can run arbitrary shell commands I'd just run my existing script every time a connection was made. But I'll try again anyway :-) It's just not documented anywhere I can find, including Brian Somer's website (http://www.awfulhak.org/freebsd.html) which, strongly hint's it's not maintained any more.

I remember using mpd# in the early days, but the Handbook says it's a solution for PPPoA. Methinks this is misleading, because I'm reading the docs and it says it's for both - leaning to PPPoE. It's also doesn't look like it's actively maintained, but at least it's more recent. So if I may widen my question to include that. Will report back on !bg specifically...

Update:
Nope!

Oct 4 14:57:52 fibre ppp[13191]: Warning: /etc/ppp/ppp.linkup: !bg /bin/echo "I am here! " HISADDR ".": Invalid command

But put a space before the pling and it does. Doah!
 
So, er, how do I mark this question as "Solved?"

The answer is to use the very precise syntax in ppp.linkup " !bg /sbin/ifconfig ....." - spaces and the bg are significant. Full write-up in my blog.
 
And that's, of course, because the linkup file, just like the main conf file, can have different sections for different connections.
If you start in the first column then ppp expects a label.
Commands must have a space or a tab in the first column.
It's all documented in ppp(8) but requires some patience and attention to discover (or an "AI" helper :) ).
In hindsight, there should have been a separate ppp.conf manual page.
 
ppp does userspace tunneling; you might want to install net/mpd5, which negotiates in userspace but handles traffic in-kernel via netgraph. it also has more extensive documentation. we used it recently to monitor a PPPoE link that was in the process of being decommissioned and it worked quite well.
 
Back
Top