On 9/4/20 8:26 AM, Bruce Dubbs via blfs-dev wrote:
On 9/4/20 12:36 AM, Tim Tassonis via blfs-dev wrote:
On 9/4/20 2:12 AM, Ken Moffat via blfs-dev wrote:
On Fri, Sep 04, 2020 at 12:44:31AM +0200, Tim Tassonis via blfs-dev
wrote:
On 9/3/20 10:29 PM, Pierre Labastie via blfs-dev wrote:
On Thu, 2020-09-03 at 21:47 +0200, Tim Tassonis via blfs-dev wrote:
On 9/1/20 7:55 PM, Bruce Dubbs via blfs-dev wrote:
On 9/1/20 12:24 PM, Tim Tassonis via blfs-dev wrote:
Hi all
As one of Switzerland largest ISP's requires pppoe with vlan
tagging
for fiber connections, I wondered if vlan tagging could get
supported
in the network scripts.
As I found out via https://wiki.archlinux.org/index.php/VLAN, one
can
create a tagged VLAN using
ip link add link $REAL_IFACE name $VLAN_IFACE type vlan id
$VLAN_ID
, so I guess this could be implemented by
- checking for $VLAN_IFACE and $VLAN_ID being set
- checking for $VLAN_ID and $REAL_IFACE (in which case IFACE
then
holds the $VLAN_IFACE)
The latter would probably be more consistent with other network
stuff,
where iface always holds the resulting interface, and not the
physical
one.
I could add this to /lib/services/pppoe, if anyone else cares.
I'm not
sure if, apart from pppoe, anyone else is interested in vlan
stuff.
I'm not even sure /lib/services/pppoe is still in blfs....
If yes, I could also add this to ipv4-static and dhcpcd.
Tim, Can you send me a patch that I can review? I would want to
make
sure that changes will not affect users that do not need them.
The patch against the pppoe service file I got is as follows:
--- pppoe-service 2018-04-18 19:18:07.739547066 +0200
+++ pppoe-service-vlan 2020-09-03 21:37:27.613134901 +0200
@@ -46,11 +46,24 @@
exit 1
fi
+if [ "x${REAL_IFACE}" != "x" ] && [ "x$x${REAL_IFACE}" != "x" ]
I'm not sure what you want to do above: if the first test is true, the
second is true too, whatever the value of $x. Typo?
Correct, "x$x${REAL_IFACE}" is a typo, it should read:
if [ "x${REAL_IFACE}" != "x" ] && [ "x${REAL_IFACE}" != "x" ]
Like this, it is a very portable way to check if both of those
variables
have any defined value. But there may be a bash shortcut, maybe:
Maybe I'm missing something (very possible), but you seem to be
testing the same variable twice:
if [ "x${REAL_IFACE}" != "x" ] && [ "x${REAL_IFACE}" != "x" ]
reformatted to put the two parts on separate lines:
if [ "x${REAL_IFACE}" != "x" ] &&
[ "x${REAL_IFACE}" != "x" ]
Looking at your original posting, I think one of these should maybe
be ${IFACE} ? It seems that if REAL_IFACE is set then an extra
module should be modprobed before pppoe is modprobed.
Oh my god, typical programmer's blindness. Here's the (hopefully)
fixed patch, and attached the fixed script:
--- pppoe-service 2018-04-18 19:18:07.739547066 +0200
+++ pppoe-service-vlan 2020-09-04 07:28:50.121311974 +0200
@@ -46,11 +46,24 @@
exit 1
fi
+if [ "x${REAL_IFACE}" != "x" ] && [ "x${VLAN_ID}" != "x" ]
+then
+ VLAN="Y"
+ /sbin/modprobe 8021q
+else
+ VLAN="N"
+fi
+
case "${2}" in
up)
/sbin/modprobe pppoe
log_info_msg2 "\n"
if is_true ${MANAGE_IFACE}; then
+ if [ "${VLAN}" = "Y" ]
+ then
+ /sbin/ip link set dev ${REAL_IFACE} up
+ /sbin/ip link add link ${REAL_IFACE} name ${IFACE} type
vlan id ${VLAN_ID}
+ fi
log_info_msg "Bringing up the ${IFACE} interface..."
/sbin/ip link set dev ${IFACE} up
evaluate_retval
@@ -68,6 +81,11 @@
if is_true ${MANAGE_IFACE}; then
log_info_msg "Bringing down the ${IFACE} interface..."
/sbin/ip link set dev ${IFACE} down
+ if [ "${VLAN}" = "Y" ]
+ then
+ /sbin/ip link set dev ${REAL_IFACE} down
+ /sbin/ip link del ${IFACE}
+ fi
evaluate_retval
fi
;;
That looks more reasonable. Now I'm trying to find a pppoe script or
service file. We have install-service-pppoe in bootscripts/Makefile,
but no blfs/services/pppoe or blfs/ppp/pppoe. I don't have any pppoe
service file either.
I just had a look, and the ppp page has been archived. I assume the
service script would/should be installed from there, as it is only
useful when using ppp.
ppp now again seems to be actively maintained by samba.org, ppp-2.4.8 is
from 2020-03-21, the first new release since 2014:
What's new in ppp-2.4.8.
************************
* New pppd options have been added:
- ifname, to set the name for the PPP interface device
- defaultroute-metric, to set the metric for the default route
- defaultroute6, to add an IPv6 default route (with nodefaultroute6
to prevent adding an IPv6 default route)
- up_sdnotify, to have pppd notify systemd when the link is up.
* The rp-pppoe plugin has new options:
- host-uniq, to set the Host-Uniq value to send
- pppoe-padi-timeout, to set the timeout for discovery packets
- pppoe-padi-attempts, to set the number of discovery attempts.
* Added the CLASS attribute in radius packets.
* Sundry bug fixes.
* Fixed warnings and issues found by static analysis.
* Added Submitting-patches.md.
I assume that ppp gets some kind of revival due to some ISP's requiring
it for fiber connections. Therefore I'd vote for de-archiving the
package. It now even has systemd suppport! Not that I'd care personally,
but probably useful for the systemd version of the book.
Bye
Tim
--
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page