On Thu, May 18, 2017 at 11:15:53AM +0000, Steve wrote:
> Thanks,I was mostly checking if this was a known issue.If I rename
> hostname.pppoe0 to hostname.pppoe1 and then rename hostname.pppoe2 to
> hostname.pppoe0The original pppoe2 (now pppoe0) works fine but the other
> interface stops working. If I swap them back the original behaviour is seen.
> ifconfig pppoe2 debug shows no ouput.As shown below pppoe2 just stays in
> state: initial.
>
> vr2: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
> lladdr 00:00:24:d1:9d:6a
> priority: 0
> media: Ethernet autoselect (100baseTX full-duplex)
> status: active
>
> pppoe2: flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> mtu 1492
> priority: 0
> dev: vr2 state: initial
> sid: 0x0 PADI retries: 0 PADR retries: 0
> groups: pppoe
> status: no carrier
>
> I have now "upgraded" to 6.1. The same is noted
> Any thoughts would be appreciated.
I believe this stopped working due to legitimate changes in how the
routing table works.
To reproduce the problem, start with a fresh routing table.
Before any interfaces (except loopback) are configured it looks like:
Destination Gateway Flags Refs Use Mtu Prio Iface
127.0.0.1 127.0.0.1 UHl 0 0 32768 1 lo1
Prepare configuration of two pppoe interfaces as per the pppoe(4) man page:
$ cat /etc/hostname.pppoe0
inet 0.0.0.0 255.255.255.255 NONE \
pppoedev em0 authproto pap \
authname 'testcaller' authkey 'donttell' up
dest 0.0.0.1
$ cat /etc/hostname.pppoe1
inet 0.0.0.0 255.255.255.255 NONE \
pppoedev em1 authproto pap \
authname 'testcaller2' authkey 'donttell2' up
dest 0.0.0.1
After 'sh /etc/netstart pppoe0' the routing table looks like:
Destination Gateway Flags Refs Use Mtu Prio Iface
0.0.0.1 default H 0 0 - 8 pppoe0
127.0.0.1 127.0.0.1 UHl 0 0 32768 1 lo1
And the pppoe interface is ready to get its addresses from the peer:
pppoe0: flags=8851<UP,POINTOPOINT,RUNNING,SIMPLEX,MULTICAST> rdomain 1 mtu 1492
index 15 priority 0 llprio 3
dev: em0 state: PADI sent
sid: 0x0 PADI retries: 18 PADR retries: 0
sppp: phase establish authproto pap
groups: pppoe
status: no carrier
inet 0.0.0.0 --> 0.0.0.1 netmask 0xffffffff
But the second interface fails to set its dest address since the same
route already exists in the table:
# sh /etc/netstart pppoe1
ifconfig: SIOCAIFADDR: File exists
So there's no address on pppoe1:
pppoe1: flags=8851<UP,POINTOPOINT,RUNNING,SIMPLEX,MULTICAST> rdomain 1 mtu 1492
index 16 priority 0 llprio 3
dev: cdce0 state: PADI sent
sid: 0x0 PADI retries: 5 PADR retries: 0
sppp: phase establish authproto pap
groups: pppoe
status: no carrier
And as a result, this code in sys/net/if_spppsubr.c cannot work:
if (myaddr == 0) {
/*
* I don't have an assigned address, so i need to
* negotiate my address.
*/
sp->ipcp.flags |= IPCP_MYADDR_DYN;
sp->ipcp.opts |= (1 << IPCP_OPT_ADDRESS);
}
if (hisaddr == 1) {
/*
* XXX - remove this hack!
* remote has no valid address, we need to get one assigned.
*/
sp->ipcp.flags |= IPCP_HISADDR_DYN;
}
It seems a correct fix would involve replacing the above code with a better
way of setting the IPCP_MYADDR_DYN and IPCP_HISADDR_DYN flags. And this
new way should not require any 'wildcard' addresses on pppoe interfaces.
One workaround is to run each pppoe interface in a separate routing domain
so that each interface gets its own routing table.
Offhand I'm not quite sure to combine this workaround with a failover setup.