Monday, August 08, 2022

Re: Making pppoe more resiliant to outages?

I have a similar experience. This is with OpenBSD 7.1 on a PC Engines
APU2. ISP is Internode with NBN FttN.

On Mon, Aug 08, 2022 at 07:39:06PM +1000, Stuart Longland wrote:
> So, I have an OpenBSD 7.0 router on a PC Engines APU3 (I'll put `dmesg`
> in shortly), which directly connects to a NBN-supplied modem (network
> termination device / "NBN Connection box"). For reasons unknown, PPPoE
> traffic is emitted to the router on VLAN ID 2.
>
> I have the following configuration:
> > vk4msl-gap# cat /etc/hostname.em2
> > up mtu 1526

$ cat /etc/hostname.em0
inet 192.168.1.2 255.255.255.0 NONE
up

> > vk4msl-gap# cat /etc/hostname.vlan2
> > vnetid 2
> > parent em2
> > txprio 1
> > up mtu 1508

I had much the same but I seem to have moved the VLAN config to the
bridge router at some stage.

> > vk4msl-gap# cat /etc/hostname.pppoe0
> > inet 0.0.0.0 255.255.255.255 NONE \
> > pppoedev vlan2 authproto chap \
> > authname user@example.com \
> > authkey hunter2 up
> > dest 0.0.0.1
> > inet6 eui64
> > !/sbin/route add default -ifp pppoe0 0.0.0.1
> > !/sbin/route add -inet6 default -ifp pppoe0 fe80::%pppoe0
> > !sleep 5
> > !/sbin/pfctl -f /etc/pf.conf
> > !/usr/local/sbin/restart-dhcp6c
> > !sleep 5
> > !/sbin/pfctl -f /etc/pf.conf

$ cat /etc/hostname.pppoe0
inet 0.0.0.0 255.255.255.255 0.0.0.1 \
llprio 1 \
pppoedev em0 authproto pap \
authname 'xxx@internode.on.net' \
authkey 'xxx' \
up
!route add default -ifp pppoe0 0.0.0.1
!route add -inet6 default -ifp pppoe0 fe80::%pppoe0 -priority 8

> This had been working fine for ages… but the past week it's been up and
> down like a yo-yo. I suspect it is *NOT* my end, but rather, common
> equipment in our area because others in my street (oddly enough,
> related ISPs) have the same problem with connectivity. *BUT* I need to
> appease L1 tech support, some of whom think a serial port is where
> sailors go for breakfast.
>
> Sometimes, the connection drops out, then returns on its own, some
> minutes later.
>

I added an ifstatd config which seems to work and the ISP sees it as a
disconnection and then reconnection:

$ cat /etc/ifstated.conf
init-state offline

ppp_up = "pppoe0.link.up"

ping_ok = '"ping -q -c 2 -w 2 8.8.4.4 >/dev/null 2>&1" every 10'

state connected {
init {
run "logger -st ifstated 'ppp connected'"
}
if $ping_ok {
set-state online
}
if ! $ppp_up {
set-state disconnected
}
}

state disconnected {
init {
run "logger -st ifstated 'ppp disconnected'"
run "ifconfig pppoe0 down"
run "sh /etc/netstart pppoe0"
}
if $ppp_up {
set-state connected
}
}

state online {
init {
run "logger -st ifstated 'ppp online'"
}
if ! $ping_ok {
set-state offline
}
if $ping_ok {
run "rcctl restart unbound"
}
}

state offline {
init {
run "logger -st ifstated 'ppp offline'"
}
if $ping_ok {
set-state online
}
if ! $ping_ok {
set-state disconnected
}
}

In hindsight is seems very hackish but like yourself it was driving me
nuts. I may now try the other suggestion on this thread.

-felix

No comments:

Post a Comment