Mpd 3.18 User Manual : Running Mpd : Mpd command line interface
Previous: mpd.script
Next: Configuring Mpd

3.3. Mpd command line interface

When run in interactive mode, or after connecting to the telnet port, mpd presents a command line interface at the console. Here mpd commands can be entered to configure the various layers and check the status of the defined bundles and links. The commands available at the command line interface are exactly the same ones available in the mpd.conf and mpd.links config files.

At any given time, there is always an active bundle and an active link within that bundle. These are shown in the prompt. Here is an example of running mpd with a configuration in mpd.conf that defines a bundle myisp containing two links modem1 and modem2:

$ mpd config1
Multi-link PPP for FreeBSD, by Archie L. Cobbs.
Based on iij-ppp, by Toshiharu OHNO.
mpd: pid 1419, version 3.0b1 (root@jan.whistle.com 10:37  7-Jan-1999)
[myisp] ppp node is "mpd771-myisp"
[myisp] using interface ng0
[myisp:modem1] 
By the time the prompt appears, mpd has already read in and executed all the commands associated with the configuration config1, which defines the bundle myisp. When the bundle is created mpd logs a message showing the name of the associated netgraph ng_ppp(4) node and system interface (mpd will automatically select one if not explicitly told which one to use). In this case mpd771-myisp is the netgraph node and ng0 is the interface. The prompt [myisp:modem1] shows the currently active bundle (myisp) and link (modem1). Any bundle specific commands issued at this point will apply to myisp. Similarly, any link specific commands will apply to modem1.

To change the active link or bundle, use the link or bundle command:

[myisp:modem1] link modem2
[myisp:modem2] 
Now any commands entered apply to myisp or modem2, as appropriate. This technique works the same way in mpd.conf. Also, if changing the link requires changing bundles as well, mpd will do that too.

The available commands are described in the next chapter. When mpd is running the help can be used to get more information on a specific command:

[myisp:modem2] help show
Commands available under "show":
 bundle   : Bundle status                ccp      : CCP status
 events   : Current events               ipcp     : IPCP status
 iface    : Interface status             routes   : IP routing table
 layers   : Layers to open/close         link     : Link status
 lcp      : LCP status                   mem      : Memory map
 mp       : Multi-link status            proto    : Protocol summary
 types    : Supported device types       version  : Version string
[myisp:modem2]

Mpd allows you to use only a prefix of a command, as long as the command is unambigous:

[myisp:modem2] b
Defined bundles:
        Bundle         Links
        ------         -----
        myisp          modem2[DOWN]
[myisp:modem2] s
s: ambiguous command


Mpd 3.18 User Manual : Running Mpd : Mpd command line interface
Previous: mpd.script
Next: Configuring Mpd