Frequently Asked Questions for FreeBSD 2.X : Networking : I can't make ppp work. What am I doing wrong ? : I keep seeing errors about magic being the same
Previous: Nothing happens after the Login OK! message
Next: LCP negotiations continue 'till the connection is closed

10.7.9. I keep seeing errors about magic being the same

Occasionally, just after connecting, you may see messages in the log that say "magic is the same". Sometimes, these messages are harmless, and sometimes one side or the other exits. Most ppp implementations cannot survive this problem, and even if the link seems to come up, you'll see repeated configure requests and configure acknowledgements in the log file until ppp eventually gives up and closes the connection.

This normally happens on server machines with slow disks that are spawning a getty on the port, and executing ppp from a login script or program after login. I've also heard reports of it happening consistently when using slirp. The reason is that in the time taken between getty exiting and ppp starting, the client-side ppp starts sending Line Control Protocol (LCP) packets. Because ECHO is still switched on for the port on the server, the client ppp sees these packets "reflect" back.

One part of the LCP negotiation is to establish a magic number for each side of the link so that "reflections" can be detected. The protocol says that when the peer tries to negotiate the same magic number, a NAK should be sent and a new magic number should be chosen. During the period that the server port has ECHO turned on, the client ppp sends LCP packets, sees the same magic in the reflected packet and NAKs it. It also sees the NAK reflect (which also means ppp must change its magic). This produces a potentially enormous number of magic number changes, all of which are happily piling into the server's tty buffer. As soon as ppp starts on the server, it's flooded with magic number changes and almost immediately decides it's tried enough to negotiate LCP and gives up. Meanwhile, the client, who no longer sees the reflections, becomes happy just in time to see a hangup from the server.

This can be avoided by allowing the peer to start negotiating with the following line in your ppp.conf file:

          set openmode passive
        

This tells ppp to wait for the server to initiate LCP negotiations. Some servers however may never initiate negotiations. If this is the case, you can do something like:

          set openmode active 3
        

This tells ppp to be passive for 3 seconds, and then to start sending LCP requests. If the peer starts sending requests during this period, ppp will immediately respond rather than waiting for the full 3 second period.


Frequently Asked Questions for FreeBSD 2.X : Networking : I can't make ppp work. What am I doing wrong ? : I keep seeing errors about magic being the same
Previous: Nothing happens after the Login OK! message
Next: LCP negotiations continue 'till the connection is closed