mxk-tutorial

title: mxk-tutorial(8)

text:
# mxk-tutorial(8)

## Overview
This tutorial shows you how to write simple mxk scripts. It assumes that you have managed to install mxk successfully.

## First script
As root run mxk without any arguments. You should see output looking something like

~# mxk

mxk: starting

mxk: starting console

mxk: starting unix monitor on /var/run/mxk

mxk: starting keyboard server

mxk: ready to serve requests

console: ready

The line console: ready is significant. It means that the console is ready to accept commands. Ignore the fact that there is no prompt. Just type in a command and then press enter. A good command would be help. This command should have lots of text scrolling past. Lets ignore that for the time being. Type list-sources instead. You should see output like this

list-sources

/dev/input/event0: unused: PC Speaker

/dev/input/event1: unused: AT Translated Set 2 keyboard

/dev/input/event2: unused: ImExPS/2 Generic Explorer Mouse

3 entries

This listing shows you what input devices the kernel thinks are connected to your system. If the listing is empty or you get an error, you either don't have any input devices or the kernel hasn't been built with evdev support. Remember you need a 2.6 series Linux kernel which knows about evdev. Try loading the evdev module explicitly with modprobe evdev or try creating the device files manually with mknod(1) in case of problems.

In all likelihood you will have some odd input devices such as power buttons and PC speakers. We will ignore these and focus on the important devices such as keyboards and mice. In the example the third device ( /dev/input/event2) is a mouse (ImExPS/2 Generic Explorer Mouse). We can tell mxk to open this device. Use the command file-source 0 /dev/input/event2 to open the device as source 0. If the open succeeds we can use the command used-sources to view more information about the device. You should see something like this:

file-source 0 /dev/input/event2

used-sources

0: ImExPS/2 Generic Explorer Mouse: bypass [sync key relative]

1 entry

The fields in the square parenthesis tell us that this device has keys (actually buttons) and can report relative movements. Good. Note the word bypass, it means the device is opened, but won't generate events just yet. We'll change that right at the end of our script, once we have set up everything else.

Now, once we have a source we want to connect something to it. Lets try a translation array. It matches a single key event and replaces it with an array of other events. First create the array, with identifier 0, using the command start-array 0. Then tell the array that for each middle click (middlebutton) we want to generate the word hi but with the i only being printed when the middlebutton is released. To achieve this enter the following two commands

press-array 0 middlebutton h/press sync: h/release sync:

release-array 0 middlebutton i/press sync: i/release sync:

So now we have a piece of logic which does the substitution. We can inspect it with the list-arrays command. You should see the following output

list-arrays

array[0]: record=<disabled>, play=<disabled>, state=play, permit=any, unknown=ignore

release middlebutton: i/press sync: i/release sync:

press middlebutton: h/press sync: h/release sync:

2 entries

Sofar we have something which collects the input (a source), and something which does a substitution (the array). Now we only need a sink or target. This one is easy to create. Just type start-target 0. The kernel should report a new device, called MXK/version (PID). If this doesn't work you don't have uinput support in your kernel or are missing the device node /dev/input/uinput. To check that this has been created, run the list-sources command again. You should see an extra entry

list-sources

/dev/input/event0: unused: PC Speaker

/dev/input/event1: unused: AT Translated Set 2 keyboard

/dev/input/event2: bypass: ImExPS/2 Generic Explorer Mouse

/dev/input/event3: target: MXK/0.1 (29378:0)

Admittedly, it is a bit confusing to have the target show up in the input list too, but the target is a special input device, one which mxk generates.

So we have generated the three nodes, a source, a processing node and a target. Now they need to be connected to each other in the correct way. This is done using the connect-node command. Type connect-node source:0 array:0 to connect the output of the source to the array and connect-node array:0 target:0 to connect the array output to the virtual input device. The target node then sends events back to the kernel and from there to all your applications.

This only leaves one more command - turning on the bypassed source node. Lets do it with activate-source 0. You can run used-sources or list-sources after that to see the status of the source changing from bypass to active.

Now if everything has worked out, middle clicks should also generate the word hi, try it. If it works congratulations, you have written your first mxk script.

## Cleaning up the first script
Suspend disbelief and pretend that the above mxk function is really useful and you need to run it occasionally.

To avoid typing out all the commands every time, save them to a file, say hi.mxk and then run it as follows mxk -p hi.mxk.

In case you want to run this in the background, use mxk -dzp hi.mxk.

If you prepend the line #/usr/sbin/mxk -dzp to the file hi.mxk and make it executable, then you can run the script directly, similar to a shell script.

Now before you send the script to your friend who also needs to have his middle mouse click say hi, you need to remove the hardcoded path to your mouse - currently this is set to /dev/input/event2. On your friends system the mouse is likely to show up as a different file.

There are two other ways of opening a source, by capability and by name.

Use caps-source to open a source by capability. Here a capability is the ability of a source to generate a certain event type, such as a key/button press or a relative motion event. Mice tend to have both these capabilities so use caps-source 0 key relative to open the first unused source which has these. Like in the case of the file-source and start-array commands, the 0 is the instance identifier. If you wish to list the types of events which mxk knows about, use the list-events command, while the used-sources command will show you the capabilities of already opened devices.

Alternatively you can use name-source to open the mouse by name, like this

name-source 0 ImExPS/2 Generic Explorer Mouse

Note that there are no quotes surrounding the name and that the match is case-sensitive. However, the name will match a substring, so name-source 0 ImExPS/2 would also have worked.

You may encounter hardware which registers multiple /dev/input/event entries, all having the same name. In such situations you may wish to try running a name match several times, as mxk will skip already opened sources. The below example illustrates this

list-sources

/dev/input/event0: unused: USBPS2

/dev/input/event1: unused: USBPS2

/dev/input/event2: unused: AT Translated Set 2 keyboard

3 entries

name-source 0 USBPS2

source: added source matching <USBPS2>

name-source 0 USBPS2

source: skipping /dev/input/event0: already in use

source: added source matching <USBPS2>

list-sources

/dev/input/event0: bypass: USBPS2

/dev/input/event1: bypass: USBPS2

/dev/input/event2: unused: AT Translated Set 2 keyboard

3 entries

So now you have several options to detect input devices on your friends PC. But what if your friend decides he doesn't need the script anymore and wants it stopped ?

When your friend is running mxk interactively, this is easy, just tell him to type halt.

However, when it is running as a daemon, he needs to reattach to the running instance using the command mxk -a and then type halt. This can be made noninteractive with a command such as echo halt | mxk -a.

## hi.mxk listing

\#/usr/sbin/mxk -dzp

caps-source 0 key relative

caps-source 0 key relative

start-array 0

press-array 0 middlebutton h/press sync: h/release sync:

release-array 0 middlebutton i/press sync: i/release sync:

start-target 0

connect-node source:0 array:0

connect-node array:0 target:0

activate-source 0

## Event Streams
The hi.mxk script sent events from a source to an array and from the array to the target. So what are these events ?

Linux evdev devices report an event as a triple of event type, code and value. For example, the enter keypress would belong to the key type, its code would be 28 (enter) and its value would be 1 (press) while the releasing the key would have a value of 0 (release).

mxk represents this triple as type:code/value. For example, relative:x/1 is an event reporting a small horizontal relative movement. Mice are examples of devices which generate relative movement events, while tablets tend to generate absolute movement events.

There are two shortcuts to be aware of:

☞

Where the type is left out, mxk assumes a key event, so enter/press is sufficient to describe the enter keypress.

☞

Thusfar there is only one event in the sync type, so sync: is sufficient to describe it.

The sync: event exists to group related events together. For example, relative:x/1 sync: relative:y/1 sync: moves the mouse right and then up, while relative:x/1 relative:y/1 sync: moves the mouse diagonally.

The commands

list-events

list-codes

list-relative

list-absolute

will list the known event types, key codes, relative axes and absolute axes respectively. For other event types, mxk has no symbolic names.

Note that most mxk processing nodes operate on certain event types only and tend to discard other types. In particular, many mxk processing nodes operate on keypress events only. As a matter of fact, mxk allocates an additional 256 virtual keys (virt1 to virt256) - these keys are not generated by real devices and silently discarded at the target device. They are however useful at intermediate stages. Examples of processing nodes emitting them are the timer and generic brailler nodes.

## Conditional Processing
The first example script was linear - all events which were not discarded took the same path (source to array to target).

Often it is useful to have events take different paths through the processing pipeline, or rather processing graph.

mxk provides several mechanisms to split the event stream. One such facility is the branch node. It splits the input stream into two - the uporhigh branch and the downorlow branch. The node maintains a global state variable which decides if the branch is up or down (like a railway switch). In addition, the branch node also maintains a map for each key event indicating if it may be relayed in any of the states and if it changes the state of the branch.

Lets create a branch, which toggles state whenever the left alt key is pressed. When in the up state, only relay the keys h,j,k and l. In the down state relays everything

start-branch 0

key-branch 0 h pass

key-branch 0 j pass

key-branch 0 k pass

key-branch 0 l pass

key-branch 0 leftalt toggle

default-branch 0 lopass

Now check its content

list-branches

branch[0]: state=down pattern[up]=<not set>, pattern[down]=<not set> pressed=0

default action: lopass

key h: hipass lopass

key j: hipass lopass

key k: hipass lopass

key l: hipass lopass

key leftalt: up down

5 entries

This branch could be used to enter a special mode where the h,j,k and l keys are mapped to mouse movements or arrow presses and all other keys do nothing.

So how does one connect this node to its downstream nodes ? The syntax to connect-node remains unchanged, but before connecting downstream nodes, force the branch node into the desired state. The below will connect the down branch directly to the target node, while the up branch will be connected to a remapping array

down-branch 0

connect-node branch:0 target:0

up-branch 0

connect-node branch:0 target:0

down-branch 0

Note the final down branch. It ensures that the system starts in a state where all keys are relayed.

Now imagine this node being connected to a source. What happens if the alt key is struck briefly while the h key is held down ? The simple approach of sending h/press down one branch and h/release down another is almost always likely to cause problems downstream. For this reason a branch node only changes state when all keys are released. Unfortunately not all keyboard (drivers) report the release of all keys reliably, especially after holding down several keys. This bug will then cause the branch node to stay stuck in one state. To confirm this problem the used-sources command to check if your keyboard thinks keys are depressed which are not.

The branch node is a useful facility to split a stream of events into two. But what if you wish to group events into many substreams ? While it is possible to connect several branch nodes together, there exists a node which can perform this in one go. This is the sorter node. The sorter node allows you to define a set of bins, numbered from zero and assign keypress events to a particular bin. Each bin can then be connected to a different downstream node. Do note that a particular keypress always ends up at a particular bin. This behaviour differs from a branch node where a keypress can potentially be sent down different paths, depending on the internal state of the branch node. So while it is a useful analogy to think of a branch node as being a railway switch, the sorter node functions more like a post office, where a letter with the same address should always go to the same postbox.

Lets create a sorter node with three bins, where the last bin is the default one - the one which receives all events not matched elsewhere

start-sorter 0 2

match-sorter 0 a 0

match-sorter 0 b 1

This node will categorise a into bin 0, b into bin 1 and all other keypresses, including c to bin 2.

Like the branch node, downstream nodes are connected using a plain connect-node command, but only before the bin to be connected has been selected using the bin-sorter command. For example, the following will connect bin 2 to an array.

bin-sorter 0 2

connect-node sorter:0 array

There exist a few other ways of classifying input streams, however these are not covered in the tutorial.

## Conclusion
This tutorial has provided a brief introduction to the commands which mxk uses to set up it processing graph. There exist several more processing nodes which have not yet been described here.

## See Also
mxk(8).


nagios-domain-discovery

package: nagios-domain-discovery

title: nagios-domain-discovery(8)

text:
# nagios-domain-discovery(8)

## NAME
nagios-domain-discovery - domain records to Nagios host list synchronization tool

## SYNOPSIS
nagios-domain-discovery [options]

## DESCRIPTION
nagios-domain-discovery is a tool to create and update the configuration of hosts under Nagios monitoring based on the domain records. It is configured with /etc/nagios/domain-discovery/main.conf and uses methods under /usr/lib/nagios-domain-discovery/methods.

## CONFIGURATION
/etc/nagios/domain-discovery is the main configuration directory with the main configuration file main.conf (see nagios-domain-discovery(5)). There are also could be configuration files for methods used by the tool, for instance, hostlist.conf (nagios-domain-discovery-hostlist(5)) for the simple domain record list method (see nagios-domain-discovery-hostlist(8)).

The methods are placed in /usr/lib/nagios-domain-discovery/methods directory.

## SEE ALSO
nagios-domain-discovery(5), nagios-domain-discovery-hostlist(8), nagios-domain-discovery-hostlist(5).


nagios-domain-discovery-hostlist

title: nagios-domain-discovery-hostlist(8)

summary: the simple domain record list method for nagios\-domain\-discovery tool

text:
# nagios-domain-discovery-hostlist(8)

## NAME
nagios-domain-discovery-hostlist - the simple domain record list method for nagios-domain-discovery tool

## SYNOPSIS
/usr/lib/nagios-domain-discovery/methods/hostlist

## DESCRIPTION
The hostlist method is intended to be used with the nagios-domain-discovery(8) tool. It uses host -l command to obtain the list of the hosts registered in the named (local) domain. It may not work with non-local domains.

For configuration parameters see nagios-domain-discovery-hostlist(5).

## SEE ALSO
nagios-domain-discovery-hostlist(8), nagios-domain-discovery(8), nagios-domain-discovery(5), nagios-domain-discovery-hostlist(5).


nagwad

package: nagwad-service

title: nagwad(8)

text:
# nagwad(8)

## NAME
nagwad - System journal event scanner and handler

## SYNOPSIS
nagwad [options] [command]

## DESCRIPTION
Daemon that continuously reads the system journal and generates events based on journal messages. The example configuration contains templates to pass the events further to Icinga and Nagios.

To run as a system service use:

nagwad --service

To list registered events use the list command:

nagwad [list]

To view one particular event use the show command:

nagwad [show] EVENT-ID

To mark an event as fixed use the fix command:

nagwad fix EVENT-ID [EVENT-ID ...]

To check all or some events use the check command:

nagwad check [FILTER]

To check for the nagwad service status use the status command:

nagwad status

To cleanup events from older system boots use the clean-old command:

nagwad cleanup-old [DAYS]

Note, that the time intervals are truncated to integer numbers. So, in order to be deleted, the log directory has to be DAYS + 1 days older.

To run in the test mode use (reading messages from standard input):

nagwad --test

## CONFIGURATION FILES
/etc/nagwad/nagwad.conf

/etc/nagwad/*.regexp

/etc/nagwad/*.sed

/etc/nagwad/filter-event.d/*

/etc/nagwad/process-event.d/*

## BUGS
Report bugs to https://bugzilla.altlinux.org/.

## COPYRIGHT
Copyright © BaseALT, Ltd. License GPLv2+: GNU GPL version 3 or later See <http://gnu.org/licenses/gpl.html> for more information.

This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

## SEE ALSO
/usr/share/doc/nagwad-service-0.11.6/README.html

/usr/share/doc/nagwad-service-0.11.6/signal.html


nbd-client

package: nbd-client

title: nbd-client(8)

text:
# nbd-client(8)

## NAME
nbd-client - connect to a server running nbd-server(1), to use its exported block device

## SYNOPSIS
nbd-client host [ port ] nbd-device [ -connections num ] [ -sdp ] [ -swap ] [ -persist ] [ -nofork ] [ -nonetlink ] [ -systemd-mark ] [ -readonly ] [ -preinit ] [ -block-size block size ] [ -size bytes ] [ -timeout seconds ] [ -name name ] [ -certfile certfile ] [ -keyfile keyfile ] [ -cacertfile cacertfile ] [ -tlshostname hostname ]

nbd-client -unix path nbd-device [ -connections num ] [ -sdp ] [ -swap ] [ -persist ] [ -nofork ] [ -nonetlink ] [ -systemd-mark ] [ -readonly ] [ -preinit ] [ -block-size block size ] [ -size bytes ] [ -timeout seconds ] [ -name name ]

nbd-client nbd-device

nbd-client -d nbd-device

nbd-client -c nbd-device

nbd-client -l host [ port ]

nbd-client [ -netlink ] -l host

## DESCRIPTION
With nbd-client, you can connect to a server running nbd-server, thus using raw diskspace from that server as a blockdevice on the local client.

To do this, support from the Linux Kernel is necessary, in the form of the Network Block Device (NBD). When you have that, either in the kernel, or as a module, you can connect to an NBD server and use its exported file through a block special file with major mode 43.

Optionally, long options can also be specified with two leading dashes.

## OPTIONS
The following options are supported:

-block-size block size

-b

Use a blocksize of "block size". Default is 512; allowed values are either 512, 1024, 2048 or 4096

-connections num

-C

Use num connections to the server, to allow speeding up request handling, at the cost of higher resource usage on the server. Use of this option requires kernel support available first with Linux 4.9.

host

The hostname or IP address of the machine running nbd-server. Since 2.9.15, the NBD utilities support IPv6.

-timeout

-t

Set the connection timeout to "seconds". For this to work, you need a kernel with support for the NBD_SET_TIMEOUT ioctl; this was introduced into Linus' tree on 2007-10-11, and will be part of kernel 2.6.24.

port

The TCP port on which nbd-server is running at the server. The port number defaults to 10809, the IANA-assigned port number for the NBD protocol.

Previous versions of the nbd tools supported an older version of the negotiation protocol known as "oldstyle". This protocol version is no longer supported as of version 3.11 of the nbd support tools.

nbd-device

The block special file (/dev entry) which this nbd-client should connect to, specified as a full path. When the mode is used wherein no hostname or export name is specified, nbd-client will look up the necessary configuration in the nbdtab file. For more information, see nbdtab(5).

-check

-c

Check whether the specified nbd device is connected. If the device is connected, nbd-client will exit with an exit state of 0 and print the PID of the nbd-client instance that connected it to stdout.

If the device is not connected or does not exist (for example because the nbd module was not loaded), nbd-client will exit with an exit state of 1 and not print anything on stdout.

If an error occurred, nbd-client will exit with an exit state of 2, and not print anything on stdout either.

-disconnect

-d

Disconnect the specified nbd device from the server

-list

-l

Ask the server for a list of available exports. If the server is exporting over IPv6 as well as over IPv4, this will list all exports twice; otherwise, it should list them all only once. Note that this option only works with nbd-server processes running version 3.1 or above, and must be enabled in server configuration (with the "allowlist" option) before it can be used.

-nonetlink

-L

Starting with version 3.17, nbd-client will default to using the netlink interface to configure an NBD device. This option allows to use the older ioctl() interface to configure the device. This option is only available if nbd-client was compiled against libnl-genl. If that is not the case, nbd-client will only be able to use the ioctl interface (and the option will not be available).

Note that a future version of nbd-client will require the use of netlink, but it has not yet been decided when that will be the case.

-persist

-p

When this option is specified, nbd-client will immediately try to reconnect an nbd device if the connection ever drops unexpectedly due to a lost server or something similar.

-preinit

-P

When this option is specified, nbd-client will skip the usual negotiation with the server, and hand the socket to the kernel immediately after connecting. Only use this when connecting to specialized NBD servers specifically designed for it. This requires specifying the size of the device via the -B option, and does not support TLS.

-readonly

-R

When this option is specified, nbd-client will tell the kernel to treat the device as read-only, even if the server would allow writes.

-size bytes

-B bytes

Force the device size to the specified number of bytes, rather than using the value from server negotiation. Must be a multiple of the block size. If using preinit (-P) to skip negotiation, this option is required.

-sdp

-S

Connect to the server using the Socket Direct Protocol (SDP), rather than IP. See nbd-server(5) for details.

-swap

-s

Specifies that this NBD device will be used as swapspace. This option attempts to prevent deadlocks by performing mlockall() and adjusting the oom-killer score at an appropriate time. It does not however guarantee that such deadlocks can be avoided.

-systemd-mark

-m

The systemd init system requires that processes which should not be killed at shutdown time be marked appropriately by replacing the first letter of their argv[0] with an '@' sign. This option will cause nbd-client to do so.

Note that this only works if nbd-client is run from an initrd; i.e., systemd will ignore such a mark if run from a systemd unit file or from the command line.

-nofork

-n

Specifies that the NBD client should not detach and daemonize itself. This is mostly useful for debugging. Note that nbd-client will still fork once to trigger an update to the device node's partition table. It is not possible to disable this.

-no-optgo

-g

Disable the use of the NBD_OPT_GO protocol message, and force the use of NBD_OPT_EXPORT_NAME instead. The NBD protocol has two phases: the negotiation phase, and the transmission phase. To move from negotation to transmission, older clients sent the NBD_OPT_EXPORT_NAME message, for which the server could not produce an error message in case the export name did not exist (or the client had insufficient permissions to access it). Due to those limitations, a replacement message NBD_OPT_GO was created instead, which allows the server to reply with an error in case of any problems.

The protocol allows for a server to discard a message which it does not understand; however, unfortunately some implementations (including older versions of nbd-server) did not handle that situation correctly and would get out of sync with the client when it sent a message which the server did not understand.

When sending NBD_OPT_GO, nbd-client will try to do the right thing and fall back to NBD_OPT_EXPORT_NAME. However, when the server has the above-described bug, then this does not work. In such a situation, the client will issue a diagnostic suggesting the use of this option.

Note that there is a corresponding option for nbdtab, too.

-name

-N

Specifies the name of the export that we want to use. If not specified, nbd-client will ask for a "default" export, if one exists on the server.

-unix

-u

Connect to the server over a unix domain socket at path, rather than to a server over a TCP socket. The server must be listening on the given socket.

-certfile file

-F

Use the specified file as the client certificate for TLS authentication to the server.

-keyfile file

-K

Use the specified file as the private key for the client cerificate.

-cacertfile file

-A

Use the specified file as the CA certificate for TLS authentication to the server.

-tlshostname hostname

-H

Use the specified hostname for the TLS context. If not specified, the hostname used to connect to the server will be used.

### TLS SUPPORT
Enabling any of the TLS-related options causes the client to use the NBD_OPT_STARTTLS command to upgrade the connection to TLS. Since negotiating TLS support from userspace for a kernel socket would be very involved (if passing keys to kernel space were even possible, which it isn't), the way this is implemented is that the nbd-client process creates a socketpair, one side of which it hands to the kernel, and the other side of which is handed to an encrypting/decrypting proxy. This has the effect that all communication will be encrypted before being sent over the wire; however, doing so is not safe in combination with swapping over an NBD device:

In order to free memory by swapping, the kernel needs to be sure that the write to the nbd device has finalized. For this, it needs to be able to receive an NBD_CMD_WRITE reply which informs it that the write has completed successfully and that the memory may be released. Receiving data over the network, however, requires that the kernel allocate memory first, which is impossible if we're low on memory (a likely situation when trying to swap). This is likely to cause a deadlock when we're low on memory and there are high amounts of network traffic.

To remedy this situation, the kernel sets the PF_MEMALLOC option on the nbd socket; when low on memory, it will throw away all packets except for those destined to a socket with that option set, relying on the normal TCP retransmit system to ensure that data is not lost. This avoids the deadlock described above.

However, the PF_MEMALLOC option is set on the socket that is connected to the nbd device, not the encrypted socket connected to the encrypting/decrypting proxy. As such, when using TLS, the PF_MEMALLOC option is not set on the socket that actually receives data from the network, which means that the deadlock reappears.

For this reason, if the -swap option is used when TLS is in use, nbd-client will issue an appropriate warning.

## EXAMPLES
Some examples of nbd-client usage:

•

To connect to a server running on port 2000 at host "server.domain.com", using the client's block special file "/dev/nbd0": nbd-client server.domain.com 2000 /dev/nbd0

•

To connect to a server running on port 2001 at host "swapserver.domain.com", using the client's block special file "/dev/nbd1", for swap purposes: nbd-client swapserver.domain.com 2001 /dev/nbd1 -swap

•

To disconnect the above connection again (after making sure the block special file is not in use anymore): nbd-client -d /dev/nbd1

## SEE ALSO
nbd-server (1).

## AUTHOR
The NBD kernel module and the NBD tools have been written by Pavel Macheck (pavel@ucw.cz).

The kernel module is now maintained by Paul Clements (Paul.Clements@steeleye.com), while the userland tools are maintained by Wouter Verhelst (wouter@debian.org)

This manual page was written by Wouter Verhelst (<wouter@debian.org>) for the Debian GNU/Linux system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation.


title: ndisc6(8)

summary: ICMPv6 Neighbor Discovery tool

text:
# ndisc6(8)

## NAME
ndisc6 - ICMPv6 Neighbor Discovery tool

## SYNOPSIS
ndisc6 [-1mnqv] [-r attempts] [-s source_ip] [-w wait_ms] <IPv6 address> <iface>

## DESCRIPTON
NDisc6 is an Unix program which implements the ICMPv6 Neighbor Discovery in userland (it is normally done by the kernel). It is used to lookup the link-layer address (layer 2 address, MAC in the case of Ethernet) of any on-link IPv6 node.

The IPv6 address of the node must be specified, as well as the networking interface on which to perform the lookup.

## OPTIONS
-1 or --single

Exit as soon as the first advertisement is received (default).

-h or --help

Display some help and exit.

-m or --multiple

Wait for possible duplicate advertisements and print all of them.

-n or --numeric

If the first parameter is not a valid IPv6 address, do not try to resolve it as a DNS hostname.

-q or --quiet

Only display link-layer address. Display nothing in case of failure. That is mostly useful when calling the program from a shell script.

-r attempts or --retry attempts

Send ICMPv6 Neighbor Discovery that many times until a reply is received, or abort. By default, ndisc6 will try 3 times before aborting (MAX_MULTICAST_SOLICIT and MAX_UNICAST_SOLICIT from RFC2461).

-s source_ip or --source source_ip

Specify the IPv6 address to be used as the source for the neighbor solicitation packets.

-V or --version

Display program version and license and exit.

-v or --verbose

Display verbose information. That is the default.

-w wait_ms or --wait wait_ms

Wait wait_ms milliseconds for a response before retrying. By default, ndisc6 waits 1 second between each attempts (RETRANS_TIMER from RFC2461).

If ndisc6 does not receive any response after the specified number of attempts waiting for wait_ms milliseconds each time, it will exit with code 2. On error, it exits with code 1. Otherwise it exits with code 0. This makes it possible to use the exit code to see if a host is on-link or not.

## DIAGNOSTICS
If you get no response while you know the remote host is up, it is most likely that it is not on-link, that is to say, you must cross one or more routers to reach it. By design, IPv6 nodes ignore ICMPv6 Neighbor Discovery packets received from nodes not on the same link (i.e. Ethernet segment), for the sake of security. Technically, that is done by ensuring that the Hop limit (TTL) is 255.

Note that you cannot use ndisc6 to lookup the local host's link-layer address.

## SECURITY
ndisc6 should be setuid root to allow use by non-privileged users. It will drop its root privileges before any attempt is made to send or receive data from the network to reduce the possible impact of a security vulnerability.

## SEE ALSO
ping6(8), rdisc6(8), ipv6(7)

## AUTHOR
Rémi Denis-Courmont <remi at remlab dot net>

http://www.remlab.net/ndisc6/


title: rdisc6(8)

summary: ICMPv6 Router Discovery tool

text:
# rdisc6(8)

## NAME
rdisc - ICMPv6 Router Discovery tool

## SYNOPSIS
rdisc6 [-qv] [-r attempts] [-s source_ip] [-w wait_ms] [IPv6 address] <iface>

## DESCRIPTON
RDisc6 is an Unix program which implements the ICMPv6 Router Discovery in userland (it is normally done by the kernel). It is used to lookup the list of on-link routers and IPv6 prefixes.

It can also be used to force the kernel to update the state of a given IPv6-autoconfigured network interface.

The name of the network interface to probe routers for must be specified.

## OPTIONS
-1 or --single

Exit as soon as the first advertisement is received.

-h or --help

Display some help and exit.

-m or --multiple

Wait for possible multiple advertisements and print all of them (default).

-n or --numeric

If the optional parameter is not a valid IPv6 address, do not try to resolve it as a DNS hostname.

-q or --quiet

Only display advertised IPv6 prefixes. Display nothing in case of failure. That is mostly useful when calling the program from a shell script.

-r attempts or --retry attempts

Send ICMPv6 Router Discovery that many times until a reply is received, or abort. By default, rdisc6 will try 3 times before aborting (MAX_RTR_SOLICITATIONS from RFC2461).

-s source_ip or --source source_ip

Specify the IPv6 address to be used as the source for the router solicitation packets.

-V or --version

Display program version and license and exit.

-v or --verbose

Display verbose information. That is the default.

-w wait_ms or --wait wait_ms

Wait wait_ms milliseconds for a response before retrying. By default, rdisc6 waits 4 second between each attempts (RTR_SOLICITATION_INTERVAL from RFC2461).

If rdisc6 does not receive any response after the specified number of attempts waiting for wait_ms milliseconds each time, it will exit with code 2. On error, it exits with code 1. Otherwise it exits with code 0.

## SECURITY
rdisc6 must be setuid root to allow use by non privileged users. It will drop its root privileges before any attempt is made to send or receive data from the network to reduce the possible impact of a security vulnerability.

## SEE ALSO
ndisc6(8), ipv6(7)

## AUTHOR
Rémi Denis-Courmont <remi at remlab dot net>

http://www.remlab.net/ndisc6/


title: rltraceroute6(8)

summary: IPv6 traceroute tool

text:
# rltraceroute6(8)

## NAME
rltraceroute6 - IPv6 traceroute tool

tcptraceroute6 - TCP/IPv6 traceroute tool

## SYNOPSIS
traceroute6 [-AdEILlnrSU] [-f min_hop] [-g hop] [ -i iface] [-m max_hop] [-p port] [-q attempts] [ -s source] [-t tclass] [-w wait] [-z delay_ms] < hostname/address> [packet length]

tcptraceroute6 [-AdEnrS] [-f min_hop] [-g hop] [ -i iface] [-l packet_size] [-m max_hop] [-p port] [ -q attempts] [-s source] [-t tclass] [-w wait] [ -z delay_ms] < hostname/address> [port]

## DESCRIPTON
rltraceroute6 is an IPv6 traceroute implementation.

It displays the list of hops along the network route between the local system and specified destination, by sending packets while incrementing their hop limit, until the final destination is reached.

By default, rltraceroute6 sends UDP probe packets toward the destination (that's the historical default). However, it can also send TCP packets, much like Michael C. Toren's tcptraceroute does on IPv4 networks; tcptraceroute6 sends TCP packets by default (and mimics tcptraceroute command line syntax). Finally, it can also send ICMPv6 Echo Request packets, like some other traceroute implementations (such as the one in Microsoft Windows); tracert6 does this by default.

You must specify the name or address of the host toward which the network route should be determined. An optional additional parameter specifies either the probe packets length (for UDP and ICMP packets), or the destination port number/service name (for TCP packets).

Note that TCP destination port zero really is TCP port numbered 0 (which cannot be used via the standard higer-level TCP/IP programming interface).

## OPTIONS
-A

Send TCP/ACK probe packets. That's very efficient against stateless firewalls (e.g. the official Linux kernel versions up to and including 2.4.31 and 2.6.14), and utterly helpless against stateful ones. Note that TCP/ACK probing cannot determine whether the destination TCP port is open or not.

-d

Enable socket debugging option (SO_DEBUG). Unless you are debugging the kernel, this is probably not going to have any actual effect.

-E

Send ECN-setup TCP/SYN probe packets (as per RFC 3168) rather than non-ECN-setup TCP/SYN probe packets. This has no effect unless command line optin -S is specified as well.

-F

This option is ignored for backward compatibility. IPv6 packets are never fragmented en route.

-f

Override the initial IPv6 packets hop limit (default: 1).

-g

Add an IPv6 route segment within an IPv6 Routing Header. This enables loose source routing. Currently, only "Type 0" routing header is supported.

-h

Display some help and exit.

-I (rltraceroute6 only)

Send ICMPv6 Echo requests (like ping6) as probe packets. That's the default for tracert6.

-i

Only send packets through the specified interface. See also BUGS.

-I (rltraceroute6 only)

Send UDP-Lite (protocol 136) packets (with full checksum coverage) as probe packets instead of normal UDP (protocol 17).

-l (rltraceroute6 only)

Print the hop limit of received packets. This is mostly used to detect asymmetric routing.

-l (tcptraceroute6 only)

Specify the size (bytes) of sent packets.

-m

Override the maximum hop limit (maximum number of hops). The default is 30 hops which should be sufficient on the IPv6 Internet for some time.

-N

Try to resolve each hop's IPv6 address to a host name. This is the default. This option is meant for backward compatibility with tcptraceroute(8).

-n

Do not try to resolve each hop's IPv6 address to a host name. That may speed up the traceroute significantly.

-p

For rltraceroute6, specify the base destination port number (default: 33434). rltraceroute6 assumes that packets toward this port up to this port plus the maximum hop limit are not in use by any program on the final destination and that they are not blocked by some firewall. The fact that this very assumption was not always correct, eventually lead to the development of the original IPv4 tcptraceroute by Michael Toren. For tcptraceroute6, specify the source port number (default: auto). Note that source port number zero really means number zero, rather than some port number that would be automatically assigned, as is the case with usual softwares.

-q

Override the number of probes sent to each hop (default: 3).

-r

Do not route packets, i.e. do not send packets through a gateway that would be specified by the routing table. See also BUGS.

-S

Use TCP/SYN probe packets. That's the default for tcptraceroute6.

-s

Specify the source address to use for probe packets explicitly.

-S

Use UDP probe packets. That's the default for rltraceroute6.

-t

Specify the traffic class (DSCP) for probe packets. See also BUGS.

-U (rltraceroute6 only)

Send UDP probe packets. That's the default.

-V

Display program version and license and exit.

-w

Override the delay (in seconds) to wait for response once a given probe packet was sent (default: 5 seconds).

-x

This option is ignored for seamless migration from IPv4 traceroute. The IPv6 header has no checksum field.

-z

Specify a milliseconds delay to wait between each probe with identical hop limit. This can be useful to work-around ICMPv6 rate limitation on some hosts.

## DIAGNOSTICS
If a response is received, the round-trip time is printed. In addition, specific symbols denote certain errors:

* No response

No valid response received before the timeout delay (see -w option).

!N No route to destination

There is no entry for the destination network in the routing table.

!A Communication with destination administratively prohibited

A firewall explicitly rejected the traffic.

!S Beyond scope of source address

The address scope of the source address is too small to reach the destination address. At the time of writing, this can only happen when using a link-local source address to reach a global scope destination. (Note: some IPv4 traceroute implementations use !S for source route error which is completely different)

!H Address unreachable

The host address is not reachable for some other reasons, particularly a link-layer failure (e.g. Neighbor discovery failure).

!P Unrecognized Next Header type encountered

The destination does not implement the layer-4 protocol used. You should retry with ICMPv6 Echo Requests (-I command line option) which MUST be supported by any IPv6 node.

## SECURITY
rltraceroute6 should be setuid root to allow use by non privileged users. It will drop its root privileges before any attempt is made to send or receive data from the network so as to reduce the possible impact of a security vulnerability.

## BUGS
However useful they might be, -i and -r options are ignored by the official Linux kernel at the time of writing this manpage, and hence do not work as documented.

Support for option -t was broken until Linux kernel version 2.6.18.

Usage of Routing Header, with option -g, triggers an OOPS on Linux kernel versions below 2.6.17.12.

Receiving TCP/SYN-ACK packets does not work on FreeBSD at all. This severely limits the usefulness of tcptraceroute6 on FreeBSD.

Packet length takes the IPv6 header and, if present, extension headers into account. rltraceroute6 versions before 0.7.4 used it as IPv6 payload length instead, i.e. did not include the layer-3 headers in the computation. Linux iputils traceroute6 does not even include the UDP header. On the whole, the packet length semantic is very inconsistent among IPv6 traceroute implementations.

## SEE ALSO
ipv6(7), traceroute(8), tcptraceroute(8), traceroute6(8)

## AUTHOR
Rémi Denis-Courmont <remi at remlab dot net>

http://www.remlab.net/ndisc6/


loadndisdriver

package: ndiswrapper

title: loadndisdriver(8)

text:
# loadndisdriver(8)

## NAME
loadndisdriver - Userspace ndis driver loader for the ndiswrapper Linux kernel module

## SYNOPSIS
loadndisdriver

## DESCRIPTION
loadndisdriver is a support program for the ndiswrapper Linux kernel module. The ndiswrapper kernel module uses it to load ndis drivers that have been installed via the ndiswrapper(8) tool.

loadndisdriver should not be used directly, only the kernel module should use it. Therefore, it's options are volatile, and subject to change during the development of the ndiswrapper kernel module.

The /etc/ndiswrapper directory is expected to contain the ndis files that loadndisdriver requires.

## SEE ALSO
ndiswrapper(8)

## AUTHOR
This manual page was written by Kel Modderman <kelrin@tpg.com.au>, for the Debian project (but may be used by others).


ndiswrapper

title: ndiswrapper(8)

text:
# ndiswrapper(8)

## NAME
ndiswrapper - Linux kernel module and user space tool to load and run Windows XP drivers for wireless cards

## SYNOPSIS
ndiswrapper

## DESCRIPTION
ndiswrapper is two parts: user space tool that is used to install Windows XP drivers and kernel module to load the Windows XP drivers. Both are called ndiswrapper.

## ndiswrapper - tool
The user space tool (/usr/sbin/ndiswrapper) is used whenever a new Windows XP driver is to be installed. This program takes the following options:

OPTIONS

-i <inf file>

installs new Windows XP driver, where <inf file> is full path to INF file for that driver.

-l

lists the currently installed drivers.

-e <driver>

removes an installed Windows XP driver named <driver>.

-m

writes an alias for wlan0 (default wireless device) into module configuration file so that ndiswrapper kernel module is loaded automatically when this interface is used.

## ndiswrapper - kernel module
The kernel module loads the installed Windows drivers and executes them so that the wireless cards can be used in Linux. The module takes the following options:

OPTIONS

if_name=<basename>

The default basename for the interface is wlan%d, so that the wireless cards will be configured as wlan0, wlan1, ... (%d is replaced with lowest available number). You may use any other basename or fixed name, such as eth%d, ndis2 etc.

proc_uid=<uid>

The module creates files in /proc/net/ndiswrapper that provide some useful information. These files are created so that they can be read only by root by default. If some other user needs to access these files without having to login as root, then replace <uid> with the user ID of that user.

proc_gid=<gid>

The module creates files in /proc/net/ndiswrapper that provide some useful information. These files are created so that they can be read only by people in root group by default. If users from other groups need to access these files, then replace <gid> with the group ID of those users. ndiswrapper kernel module uses loadndisdriver user space tool to load all the Windows drivers. This tool is not to be used under normal circumstances. Only when ndiswrapper module is already loaded and a new Windows XP driver is installed (by ndiswrapper user space tool) and you want the kernel module to load that driver without having to unload the module that you need to use it.

## AUTHOR
This manual page was written by Giridhar Pemmasani <ndiswrapper-general@lists.sourceforge.net>, for the Debian project (but may be used by others).


neard

package: neard

title: neard(8)

summary: Near Field Communication daemon

text:
# neard(8)

## NAME
neard - Near Field Communication daemon

## SYNOPSIS
neard [--version] | [--help]

neard [--debug=<file1>:<file2>:...] [--plugin=<plugin1>,<plugin2>,...] [--noplugin=<plugin1>,<plugin2>,...] [--nodaemon]

## DESCRIPTION
neard is an NFC (Near Field Communication) daemon for managing NFC operations on devices running the Linux operating system. It relies on the Linux kernel NFC socket and generic netlink families, and is a fully modular system that can be extended through plug-ins.

It supports all 4 NFC tag types reading and writing, along with NFC LLCP (peer to peer mode) in both target and initiator modes. The Simple NDEF Exchange Protocol (SNEP), NDEF Push Protocol (NPP) and handover (Wi-Fi and Bluetooth) protocols are implemented as separate plugins on top of LLCP sockets.

## OPTIONS
The following options are supported:

--version

Print the neard software version and exit.

--help

Print neard's available options and exit.

--debug=<file1>:<file2>:...

Sets how much information neard sends to the log destination (usually syslog's "daemon" facility). If the file options are omitted, then debugging information from all the source files are printed. If file options are present, then only debug prints from that source file are printed. Example: --debug=src/service.c:plugins/wifi.c

--plugin=<plugin1>,<plugin2>,...

Load these plugins only. The option can be a pattern containing "*" and "?" characters.

--noplugin=<plugin1>,<plugin2>,...

Never load these plugins. The option can be a pattern containing "*" and "?" characters.

--nodaemon

Do not daemonize. This is useful for debugging, and directs log output to the controlling terminal in addition to syslog.

## SEE ALSO
neard.conf(5).


snmpd

package: net-snmp-snmpd

title: snmpd(8)

text:
# snmpd(8)

## NAME
snmpd - daemon to respond to SNMP request packets.

## SYNOPSIS
snmpd [OPTIONS] [LISTENING ADDRESSES]

## DESCRIPTION
snmpd is an SNMP agent which binds to a port and awaits requests from SNMP management software. Upon receiving a request, it processes the request(s), collects the requested information and/or performs the requested operation(s) and returns the information to the sender.

## OPTIONS
-a

Log the source addresses of incoming requests.

-A

Append to the log file rather than truncating it.

-c FILE

Read FILE as a configuration file (or a comma-separated list of configuration files). Note that the loaded file will only understand snmpd.conf tokens, unless the configuration type is specified in the file as described in the snmp_config man page under SWITCHING CONFIGURATION TYPES IN MID-FILE.

-C

Do not read any configuration files except the ones optionally specified by the -c option. Note that this behaviour also covers the persistent configuration files. This may result in dynamically-assigned values being reset following an agent restart, unless the relevant persistent config files are explicitly loaded using the -c option.

-d

Dump (in hexadecimal) the sent and received SNMP packets.

-D[TOKEN[,...]]

Turn on debugging output for the given TOKEN(s). Without any tokens specified, it defaults to printing all the tokens (which is equivalent to the keyword "ALL"). You might want to try ALL for extremely verbose output. Note: You can not put a space between the -D flag and the listed TOKENs.

-f

Do not fork() from the calling shell.

-g GID

Change to the numerical group ID GID after opening listening sockets.

-h, --help

Display a brief usage message and then exit.

-H

Display a list of configuration file directives understood by the agent and then exit.

-I [-]INITLIST

Specifies which modules should (or should not) be initialized when the agent starts up. If the comma-separated INITLIST is preceded with a '-', it is the list of modules that should not be started. Otherwise this is the list of the only modules that should be started. To get a list of compiled modules, run the agent with the arguments -Dmib_init -H (assuming debugging support has been compiled in).

-L[eEfFoOsSnN]

Specify where logging output should be directed (standard error or output, to a file or via syslog). See LOGGING OPTIONS in snmpcmd(1) for details.

-m MIBLIST

Specifies a colon separated list of MIB modules to load for this application. This overrides the environment variable MIBS. See snmpcmd(1) for details.

-M DIRLIST

Specifies a colon separated list of directories to search for MIBs. This overrides the environment variable MIBDIRS. See snmpcmd(1) for details.

-n NAME

Set an alternative application name (which will affect the configuration files loaded). By default this will be snmpd, regardless of the name of the actual binary.

-p FILE

Save the process ID of the daemon in FILE.

-q

Print simpler output for easier automated parsing.

-r

Do not require root access to run the daemon. Specifically, do not exit if files only accessible to root (such as /dev/kmem etc.) cannot be opened.

-u UID

Change to the user ID UID (which can be given in numerical or textual form) after opening listening sockets.

-U

Instructs the agent to not remove its pid file (see the -p option) on shutdown. Overrides the leave_pidfile token in the snmpd.conf file, see snmpd.conf(5).

-v, --version

Print version information for the agent and then exit.

-V

Symbolically dump SNMP transactions.

-x ADDRESS

Listens for AgentX connections on the specified address rather than the default "/var/agentx/master". The address can either be a Unix domain socket path, or the address of a network interface. The format is the same as the format of listening addresses described below.

-X

Run as an AgentX subagent rather than as an SNMP master agent.

--name="value"

Allows one to specify any token ("name") supported in the snmpd.conf file and sets its value to "value". Overrides the corresponding token in the snmpd.conf file. See snmpd.conf(5) for the full list of tokens.

## LISTENING ADDRESSES
By default, snmpd listens for incoming SNMP requests on UDP port 161 on all IPv4 interfaces. However, it is possible to modify this behaviour by specifying one or more listening addresses as arguments to snmpd. A listening address takes the form:

[<transport-specifier>:]<transport-address>

At its simplest, a listening address may consist only of a port number, in which case snmpd listens on that UDP port on all IPv4 interfaces. Otherwise, the <transport-address> part of the specification is parsed according to the following table:

<transport-specifier>

<transport-address> format

udp (default)

hostname[:port] or IPv4-address[:port]

tcp

hostname[:port] or IPv4-address[:port]

unix

pathname

ipx

[network]:node[/port]

aal5pvc or pvc

[interface.][VPI.]VCI

udp6 or udpv6 or udpipv6

hostname[:port] or IPv6-address[:port]

tcp6 or tcpv6 or tcpipv6

hostname[:port] or IPv6-address[:port]

ssh

hostname:port

dtlsudp

hostname:port

Note that <transport-specifier> strings are case-insensitive so that, for example, "tcp" and "TCP" are equivalent. Here are some examples, along with their interpretation:

127.0.0.1:161

listen on UDP port 161, but only on the loopback interface. This prevents snmpd being queried remotely. The port specification ":161" is not strictly necessary since that is the default SNMP port.

TCP:1161

listen on TCP port 1161 on all IPv4 interfaces.

ipx:/40000

listen on IPX port 40000 on all IPX interfaces.

unix:/tmp/local-agent

listen on the Unix domain socket /tmp/local-agent.

/tmp/local-agent

is identical to the previous specification, since the Unix domain is assumed if the first character of the <transport-address> is '/'.

PVC:161

listen on the AAL5 permanent virtual circuit with VPI=0 and VCI=161 (decimal) on the first ATM adapter in the machine.

udp6:10161

listen on port 10161 on all IPv6 interfaces.

ssh:127.0.0.1:22

Allows connections from the snmp subsystem on the ssh server on port 22. The details of using SNMP over SSH are defined below.

dtlsudp:127.0.0.1:9161

Listen for connections over DTLS on UDP port 9161. The snmp.conf file must have the serverCert, configuration tokens defined.

Note that not all the transport domains listed above will always be available; for instance, hosts with no IPv6 support will not be able to use udp6 transport addresses, and attempts to do so will result in the error "Error opening specified endpoint". Likewise, since AAL5 PVC support is only currently available on Linux, it will fail with the same error on other platforms.

## Transport Specific Notes
ssh

The SSH transport, on the server side, is actually just a unix named pipe that can be connected to via a ssh subsystem configured in the main ssh server. The pipe location (configurable with the sshtosnmpsocket token in snmp.conf) is /var/net-snmp/sshtosnmp. Packets should be submitted to it via the sshtosnmp application, which also sends the user ID as well when starting the connection. The TSM security model should be used when packets should process it.

The sshtosnmp command knows how to connect to this pipe and talk to it. It should be configured in the OpenSSH sshd configuration file (which is normally /etc/ssh/sshd_config using the following configuration line:

Subsystem snmp /usr/local/bin/sshtosnmp

The sshtosnmp command will need read/write access to the /var/net-snmp/sshtosnmp pipe. Although it should be fairly safe to grant access to the average user since it still requires modifications to the ACM settings before the user can perform operations, paranoid administrators may want to make the /var/net-snmp directory accessible only by users in a particular group. Use the sshtosnmpsocketperms snmp.conf configure option to set the permissions, owner and group of the created socket.

Access control can be granted to the user "foo" using the following style of simple snmpd.conf settings:

rouser -s tsm foo authpriv

Note that "authpriv" is acceptable assuming as SSH protects everything that way (assuming you have a non-insane setup). snmpd has no notion of how SSH has actually protected a packet and thus the snmp agent assumes all packets passed through the SSH transport have been protected at the authpriv level.

dtlsudp

The DTLS protocol, which is based off of TLS, requires both client and server certificates to establish the connection and authenticate both sides. In order to do this, the client will need to configure the snmp.conf file with the clientCert configuration tokens. The server will need to configure the snmp.conf file with the serverCert configuration tokens defined.

Access control setup is similar to the ssh transport as the TSM security model should be used to protect the packet.

## CONFIGURATION FILES
snmpd checks for the existence of and parses the following files:

/etc/snmp/snmp.conf

Common configuration for the agent and applications. See snmp.conf(5) for details.

/etc/snmp/snmpd.conf

/etc/snmp/snmpd.local.conf

Agent-specific configuration. See snmpd.conf(5) for details. These files are optional and may be used to configure access control, trap generation, subagent protocols and much else besides.

In addition to these two configuration files in /etc/snmp, the agent will read any files with the names snmpd.conf and snmpd.local.conf in a colon separated path specified in the SNMPCONFPATH environment variable.

/usr/share/snmp/mibs/

The agent will also load all files in this directory as MIBs. It will not, however, load any file that begins with a '.' or descend into subdirectories.

## SEE ALSO
(in recommended reading order)

snmp_config(5), snmp.conf(5), snmpd.conf(5)


snmptrapd

package: net-snmp-snmptrapd

title: snmptrapd(8)

text:
# snmptrapd(8)

## NAME
snmptrapd - Receive and log SNMP trap messages.

## SYNOPSIS
snmptrapd [OPTIONS] [LISTENING ADDRESSES]

## DESCRIPTION
snmptrapd is an SNMP application that receives and logs SNMP TRAP and INFORM messages.

Note: the default is to listen on UDP port 162 on all IPv4 interfaces. Since 162 is a privileged port, snmptrapd must typically be run as root.

## OPTIONS
-a

Ignore authenticationFailure traps.

-A

Append to the log file rather than truncating it. Note that this needs to come before any -Lf options that it should apply to.

-c FILE

Read FILE as a configuration file (or a comma-separated list of configuration files).

-C

Do not read any configuration files except the one optionally specified by the -c option.

-d

Dump (in hexadecimal) the sent and received SNMP packets.

-D[TOKEN[,...]]

Turn on debugging output for the given TOKEN(s). Try ALL for extremely verbose output.

-f

Do not fork() from the calling shell.

-F FORMAT

When logging to standard output, use the format in the string FORMAT. See the section FORMAT SPECIFICATIONS below for more details.

-h, --help

Display a brief usage message and then exit.

-H

Display a list of configuration file directives understood by the trap daemon and then exit.

-I [-]INITLIST

Specifies which modules should (or should not) be initialized when snmptrapd starts up. If the comma-separated INITLIST is preceded with a '-', it is the list of modules that should not be started. Otherwise this is the list of the only modules that should be started. To get a list of compiled modules, run snmptrapd with the arguments -Dmib_init -H (assuming debugging support has been compiled in).

-L[efos]

Specify where logging output should be directed (standard error or output, to a file or via syslog). See LOGGING OPTIONS in snmpcmd(1) for details.

-m MIBLIST

Specifies a colon separated list of MIB modules to load for this application. This overrides the environment variable MIBS. See snmpcmd(1) for details.

-M DIRLIST

Specifies a colon separated list of directories to search for MIBs. This overrides the environment variable MIBDIRS. See snmpcmd(1) for details.

-n

Do not attempt to translate source addresses of incoming packets into hostnames.

-p FILE

Save the process ID of the trap daemon in FILE.

-O [abeEfnqQsStTuUvxX]

Specifies how MIB objects and other output should be displayed. See the section OUTPUT OPTIONS in the snmpcmd(1) manual page for details.

-t

Do not log traps to syslog. This disables logging to syslog. This is useful if you want the snmptrapd application to only run traphandle hooks and not to log any traps to any location.

-v, --version

Print version information for the trap daemon and then exit.

-x ADDRESS

Connect to the AgentX master agent on the specified address, rather than the default "/var/agentx/master". See snmpd(8) for details of the format of such addresses.

-X

Do not connect to a AgentX master agent

--name="value"

Allows one to specify any token ("name") supported in the snmptrapd.conf file and sets its value to "value". Overrides the corresponding token in the snmptrapd.conf file. See snmptrapd.conf(5) for the full list of tokens.

## FORMAT SPECIFICATIONS
snmptrapd interprets format strings similarly to printf(3). It understands the following formatting sequences:

%%

a literal %

%a

the contents of the agent-addr field of the PDU (v1 TRAPs only)

%A

the hostname corresponding to the contents of the agent-addr field of the PDU, if available, otherwise the contents of the agent-addr field of the PDU (v1 TRAPs only).

%b

PDU transport address (Note: this is not necessarily an IPv4 address).

Something like "[UDP: [172.16.10.12]:23456->[10.150.0.8]]"

%B

PDU source hostname if available, otherwise PDU source address (see note above)

%E

SNMPv3 context engine id

%h

current hour on the local system

%H

the hour field from the sysUpTime.0 varbind

%j

current minute on the local system

%J

the minute field from the sysUpTime.0 varbind

%k

current second on the local system

%K

the seconds field from the sysUpTime.0 varbind

%l

current day of month on the local system

%L

the day of month field from the sysUpTime.0 varbind

%m

current (numeric) month on the local system

%M

the numeric month field from the sysUpTime.0 varbind

%N

enterprise string

%P

security information from the PDU (community name for v1/v2c, user and context for v3)

%q

trap sub-type (numeric, in decimal)

%s

SNMP version number (0: v1, 1: v2c, 2: v3)

%S

SNMPv3 security model version number

%t

decimal number of seconds since the operating system epoch (as returned by time(2))

%T

the value of the sysUpTime.0 varbind in seconds

%u

SNMPv3 security name, or v1/v2c community name

%v

list of variable-bindings from the notification payload. These will be separated by a tab, or by a comma and a blank if the alternate form is requested See also %V

%V

specifies the variable-bindings separator. This takes a sequence of characters, up to the next % (to embed a % in the string, use \%)

%w

trap type (numeric, in decimal)

%W

trap description

%y

current year on the local system

%Y

the year field from the sysUpTime.0 varbind

In addition to these values, an optional field width and precision may also be specified , just as in printf(3), and a flag value. The following flags are supported:

-

left justify

0

use leading zeros

\#

use alternate form

The "use alternate form" flag changes the behavior of various format string sequences:

Time information will be displayed based on GMT (rather than the local timezone)

The variable-bindings will be a comma-separated list (rather than a tab-separated one)

The system uptime will be broken down into a human-meaningful format (rather than being a simple integer)

### Examples:
To get a message like "14:03 TRAP3.1 from humpty.ucd.edu" you could use something like this:

```
snmptrapd -P -F "%02.2h:%02.2j TRAP%w.%q from %A\n"
```

If you want the same thing but in GMT rather than local time, use

```
snmptrapd -P -F "%#02.2h:%#02.2j TRAP%w.%q from %A\n"
```

## LISTENING ADDRESSES
By default, snmptrapd listens for incoming SNMP TRAP and INFORM packets on UDP port 162 on all IPv4 interfaces. However, it is possible to modify this behaviour by specifying one or more listening addresses as arguments to snmptrapd. See the snmpd(8) manual page for more information about the format of listening addresses.

## NOTIFICATION-LOG-MIB SUPPORT
As of net-snmp 5.0, the snmptrapd application supports the NOTIFICATION-LOG-MIB. It does this by opening an AgentX subagent connection to the master snmpd agent and registering the notification log tables. As long as the snmpd application is started first, it will attach itself to it and thus you should be able to view the last recorded notifications via the nlmLogTable and nlmLogVariableTable. See the snmptrapd.conf file and the "doNotRetainNotificationLogs" token for turning off this support. See the NOTIFICATION-LOG-MIB for more details about the MIB itself.

## EXTENSIBILITY AND CONFIGURATION
See the snmptrapd.conf(5) manual page.

## SEE ALSO
snmpcmd(1), snmpd(8), printf(3), snmptrapd.conf(5), syslog(8), traptoemail(1), variables(5)


arp

package: net-tools

title: arp(8)

summary: manipulate the system ARP cache

text:
# arp(8)

## NAME
arp - manipulate the system ARP cache

## SYNOPSIS
arp [-evn] [-H type] [-i if] -a [hostname]

arp [-v] [-i if] -d hostname [pub]

arp [-v] [-H type] [-i if] -s hostname hw_addr [temp]

arp [-v] [-H type] [-i if] -s hostname hw_addr [netmask nm] pub

arp [-v] [-H type] [-i if] -Ds hostname ifa [netmask nm] pub

arp [-vnD] [-H type] [-i if] -f [filename]

## NOTE
This program is obsolete. For replacement check ip neighbor.

## DESCRIPTION
Arp manipulates the kernel's ARP cache in various ways. The primary options are clearing an address mapping entry and manually setting up one. For debugging purposes, the arp program also allows a complete dump of the ARP cache.

## OPTIONS
-v, --verbose

Tell the user what is going on by being verbose.

-n, --numeric

shows numerical addresses instead of trying to determine symbolic host, port or user names.

-H type, --hw-type type, -t type

When setting or reading the ARP cache, this optional parameter tells arp which class of entries it should check for. The default value of this parameter is ether (i.e. hardware code 0x01 for IEEE 802.3 10Mbps Ethernet). Other values might include network technologies such as ARCnet (arcnet) , PROnet (pronet) , AX.25 (ax25) and NET/ROM (netrom).

-a [hostname], --all [hostname]

Shows the entries of the specified hosts. If the hostname parameter is not used, all entries will be displayed. The entries will be displayed in alternate (BSD) style.

-d hostname, --delete hostname

Remove any entry for the specified host. This can be used if the indicated host is brought down, for example.

-D, --use-device

Use the interface ifa's hardware address.

-e

Shows the entries in default (Linux) style.

-i If, --device If

Select an interface. When dumping the ARP cache only entries matching the specified interface will be printed. When setting a permanent or temp ARP entry this interface will be associated with the entry; if this option is not used, the kernel will guess based on the routing table. For pub entries the specified interface is the interface on which ARP requests will be answered. NOTE: This has to be different from the interface to which the IP datagrams will be routed.

-s hostname hw_addr, --set hostname

Manually create an ARP address mapping entry for host hostname with hardware address set to hw_addr class, but for most classes one can assume that the usual presentation can be used. For the Ethernet class, this is 6 bytes in hexadecimal, separated by colons. When adding proxy arp entries (that is those with the publish flag set a netmask may be specified to proxy arp for entire subnets. This is not good practice, but is supported by older kernels because it can be useful. If the temp flag is not supplied entries will be permanent stored into the ARP cache.

NOTE: As of kernel 2.2.0 it is no longer possible to set an ARP entry for an entire subnet. Linux instead does automagic proxy arp when a route exists and it is forwarding. See arp(7) for details.

-f filename, --file filename

Similar to the -s option, only this time the address info is taken from file filename set up. The name of the data file is very often /etc/ethers, but this is not official. If no filename is specified /etc/ethers is used as default. The format of the file is simple; it only contains ASCII text lines with a hardware address and a hostname separated by whitespace. Additionally the pub, temp and netmask flags can be used.

In all places where a hostname is expected, one can also enter an IP address in dotted-decimal notation.

As a special case for compatibility the order of the hostname and the hardware address can be exchanged.

Each complete entry in the ARP cache will be marked with the C flag. Permanent entries are marked with M and published entries have the P flag.

## FILES
/proc/net/arp,

/etc/networks

/etc/hosts

/etc/ethers

## SEE ALSO
ip(8)

## AUTHORS
Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> with a lot of improvements from net-tools Maintainer Bernd Eckenfels <net-tools@lina.inka.de>.


ifconfig

title: ifconfig(8)

summary: configure a network interface

text:
# ifconfig(8)

## NAME
ifconfig - configure a network interface

## SYNOPSIS
ifconfig [interface]

ifconfig interface [aftype] options | address ...

## NOTE
This program is obsolete! For replacement check ip addr and ip link. For statistics use ip -s link.

## DESCRIPTION
Ifconfig is used to configure the kernel-resident network interfaces. It is used at boot time to set up interfaces as necessary. After that, it is usually only needed when debugging or when system tuning is needed.

If no arguments are given, ifconfig displays the status of the currently active interfaces. If a single interface argument is given, it displays the status of the given interface only; if a single -a argument is given, it displays the status of all interfaces, even those that are down. Otherwise, it configures an interface.

## Address Families
If the first argument after the interface name is recognized as the name of a supported address family, that address family is used for decoding and displaying all protocol addresses. Currently supported address families include inet (TCP/IP, default), inet6 (IPv6), ax25 (AMPR Packet Radio), ddp (Appletalk Phase 2), ipx (Novell IPX) and netrom (AMPR Packet radio). All numbers supplied as parts in IPv4 dotted decimal notation may be decimal, octal, or hexadecimal, as specified in the ISO C standard (that is, a leading 0x or 0X implies hexadecimal; otherwise, a leading '0' implies octal; otherwise, the number is interpreted as decimal). Use of hexamedial and octal numbers is not RFC-compliant and therefore its use is discouraged and may go away.

## OPTIONS
interface

The name of the interface. This is usually a driver name followed by a unit number, for example eth0 for the first Ethernet interface.

up

This flag causes the interface to be activated. It is implicitly specified if an address is assigned to the interface.

down

This flag causes the driver for this interface to be shut down.

[-]arp

Enable or disable the use of the ARP protocol on this interface.

[-]promisc

Enable or disable the promiscuous mode of the interface. If selected, all packets on the network will be received by the interface.

[-]allmulti

Enable or disable all-multicast mode. If selected, all multicast packets on the network will be received by the interface.

metric N

This parameter sets the interface metric. It is not available under GNU/Linux.

mtu N

This parameter sets the Maximum Transfer Unit (MTU) of an interface.

dstaddr addr

Set the remote IP address for a point-to-point link (such as PPP). This keyword is now obsolete; use the pointopoint keyword instead.

netmask addr

Set the IP network mask for this interface. This value defaults to the usual class A, B or C network mask (as derived from the interface IP address), but it can be set to any value.

add addr/prefixlen

Add an IPv6 address to an interface.

del addr/prefixlen

Remove an IPv6 address from an interface.

tunnel ::aa.bb.cc.dd

Create a new SIT (IPv6-in-IPv4) device, tunnelling to the given destination.

irq addr

Set the interrupt line used by this device. Not all devices can dynamically change their IRQ setting.

io_addr addr

Set the start address in I/O space for this device.

mem_start addr

Set the start address for shared memory used by this device. Only a few devices need this.

media type

Set the physical port or medium type to be used by the device. Not all devices can change this setting, and those that can vary in what values they support. Typical values for type are 10base2 (thin Ethernet), 10baseT (twisted-pair 10Mbps Ethernet), AUI (external transceiver) and so on. The special medium type of auto can be used to tell the driver to auto-sense the media. Again, not all drivers can do this.

[-]broadcast [addr]

If the address argument is given, set the protocol broadcast address for this interface. Otherwise, set (or clear) the IFF_BROADCAST flag for the interface.

[-]pointopoint [addr]

This keyword enables the point-to-point mode of an interface, meaning that it is a direct link between two machines with nobody else listening on it.

If the address argument is also given, set the protocol address of the other side of the link, just like the obsolete dstaddr keyword does. Otherwise, set or clear the IFF_POINTOPOINT flag for the interface.

hw class address

Set the hardware address of this interface, if the device driver supports this operation. The keyword must be followed by the name of the hardware class and the printable ASCII equivalent of the hardware address. Hardware classes currently supported include ether (Ethernet), ax25 (AMPR AX.25), ARCnet and netrom (AMPR NET/ROM).

multicast

Set the multicast flag on the interface. This should not normally be needed as the drivers set the flag correctly themselves.

address

The IP address to be assigned to this interface.

txqueuelen length

Set the length of the transmit queue of the device. It is useful to set this to small values for slower devices with a high latency (modem links, ISDN) to prevent fast bulk transfers from disturbing interactive traffic like telnet too much.

## NOTES
Since kernel release 2.2 there are no explicit interface statistics for alias interfaces anymore. The statistics printed for the original address are shared with all alias addresses on the same device. If you want per-address statistics you should add explicit accounting rules for the address using the ipchains(8) command.

Interrupt problems with Ethernet device drivers fail with EAGAIN. See http://www.scyld.com/expert/irq-conflict.html for more information.

## FILES
/proc/net/socket

/proc/net/dev

/proc/net/if_inet6

## BUGS
Ifconfig uses obsolete kernel interface. It uses the ioctl access method to get the full address information, which limits hardware addresses to 8 bytes. Since an Infiniband address is 20 bytes, only the first 8 bytes of Infiniband address are displayed.

While appletalk DDP and IPX addresses will be displayed they cannot be altered by this command.

## SEE ALSO
ip(8)

## AUTHORS
Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>

Alan Cox, <Alan.Cox@linux.org>

Phil Blundell, <Philip.Blundell@pobox.com>

Andi Kleen


ipmaddr

title: ipmaddr(8)

text:
# ipmaddr(8)

## NAME
ipmaddr - adds, deletes, and displays multicast addresses

## SYNOPSIS
/usr/sbin/ipmaddr [<operation>] [<args>]

## NOTE
This program is obsolete. For replacement check ip maddress.

## DESCRIPTION
The ipmaddr command can perform one of the following operations:

add - add a multicast address

del - delete a multicast address

show - list multicast addresses

## SEE ALSO
ip(8).


iptunnel

title: iptunnel(8)

text:
# iptunnel(8)

## NAME
iptunnel - creates, deletes, and displays configured tunnels

## SYNOPSIS
/usr/sbin/iptunnel [<operation>] [<args>]

## NOTE
This program is obsolete. For replacement check ip tunnel.

## DESCRIPTION
The iptunnel command creates configured tunnels for sending and receiving IPV6 or IPV4 packets that are encapsulated as the payload of an IPV4 datagram.

The iptunnel command can perform one of the following operations:

create - create a tunnel interface, which you must subsequently configure.

delete - delete a tunnel interface. You must disable the tunnel before you can delete it.

show - show the tunnel attributes (name, tunnel end points, next hop for tunneled packets).

## SEE ALSO
ip(8).


mii-tool

title: mii-tool(8)

text:
# mii-tool(8)

## NAME
mii-tool - view, manipulate media-independent interface status

## SYNOPSIS
mii-tool [-v, --verbose] [-V, --version] [-R, --reset] [-r, --restart] [-w, --watch] [-l, --log] [-A, --advertise=media,...] [-F, --force=media] [interface ...]

## NOTE
This program is obsolete. Valid media are only 100baseT4, 100baseTx-FD,100baseTx-HD, 10baseT-FD and 10baseT-HD ethernet cards. For replacement check ethtool.

## DESCRIPTION
This utility checks or sets the status of a network interface's Media Independent Interface (MII) unit. Most fast ethernet adapters use an MII to autonegotiate link speed and duplex setting.

Most intelligent network devices use an autonegotiation protocol to communicate what media technologies they support, and then select the fastest mutually supported media technology. The -A or --advertise options can be used to tell the MII to only advertise a subset of its capabilities. Some passive devices, such as single-speed hubs, are unable to autonegotiate. To handle such devices, the MII protocol also allows for establishing a link by simply detecting either a 10baseT or 100baseT link beat. The -F or --force options can be used to force the MII to operate in one mode, instead of autonegotiating. The -A and -F options are mutually exclusive.

The default short output reports the negotiated link speed and link status for each interface. If an interface or interfaces are not specified on the command line, then mii-tool will check any available interfaces from eth0 through eth7.

## OPTIONS
-v, --verbose

Display more detailed MII status information. If used twice, also display raw MII register contents.

-V, --version

Display program version information.

-R, --reset

Reset the MII to its default configuration.

-r, --restart

Restart autonegotiation.

-w, --watch

Watch interface(s) and report changes in link status. The MII interfaces are polled at one second intervals.

-l, --log

Used with -w, records link status changes in the system log instead of printing on standard output.

-F media, --force=media

Disable autonegotiation, and force the MII to either 100baseTx-FD, 100baseTx-HD, 10baseT-FD, or 10baseT-HD operation.

-A media,..., --advertise=media,...

Enable and restart autonegotiation, and advertise only the specified media technologies. Multiple technologies should be separated by commas. Valid media are 100baseT4, 100baseTx-FD, 100baseTx-HD, 10baseT-FD, and 10baseT-HD.

## SEE ALSO
ethtool(8)

## AUTHORS
David Hinds - dhinds@pcmcia.sourceforge.org

Donald Becker - becker@scyld.com


nameif

title: nameif(8)

text:
# nameif(8)

## NAME
nameif - name network interfaces based on MAC addresses

## SYNOPSIS
nameif [-c configfile] [-s]

nameif [-c configfile] [-s] {interface macaddress}

## NOTE
This program is obsolete. For replacement check ip link. This functionality is also much better provided by udev methods.

## DESCRIPTION
nameif renames network interfaces based on mac addresses. When no arguments are given /etc/mactab is read. Each line of it contains an interface name and a Ethernet MAC address. Comments are allowed starting with #. Otherwise the interfaces specified on the command line are processed. nameif looks for the interface with the given MAC address and renames it to the name given.

When the -s argument is given all error messages go to the syslog.

When the -c argument is given with a file name that file is read instead of /etc/mactab.

## NOTES
nameif should be run before the interface is up, otherwise it'll fail.

## FILES
/etc/mactab

## SEE ALSO
ip(8), udev(7)

## BUGS
Only works for Ethernet currently.


netstat

title: netstat(8)

text:
# netstat(8)

## NAME
netstat - Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships

## SYNOPSIS
netstat [address_family_options] [--tcp|-t] [--udp|-u] [--raw|-w] [--listening|-l] [--all|-a] [--numeric|-n] [--numeric-hosts][--numeric-ports][--numeric-ports] [--symbolic|-N] [--extend|-e[--extend|-e]] [--timers|-o] [--program|-p] [--verbose|-v] [--continuous|-c] [delay]

netstat {--route|-r} [address_family_options] [--extend|-e[--extend|-e]] [--verbose|-v] [--numeric|-n] [--numeric-hosts][--numeric-ports][--numeric-ports] [--continuous|-c] [delay]

netstat {--interfaces|-I|-i} [iface] [--all|-a] [--extend|-e] [--verbose|-v] [--program|-p] [--numeric|-n] [--numeric-hosts][--numeric-ports][--numeric-ports] [--continuous|-c] [delay]

netstat {--groups|-g} [--numeric|-n] [--numeric-hosts][--numeric-ports][--numeric-ports] [--continuous|-c] [delay]

netstat {--masquerade|-M} [--extend|-e] [--numeric|-n] [--numeric-hosts][--numeric-ports][--numeric-ports] [--continuous|-c] [delay]

netstat {--statistics|-s} [--tcp|-t] [--udp|-u] [--raw|-w] [delay]

netstat {--version|-V}

netstat {--help|-h}

address_family_options:

[--protocol={inet,unix,ipx,ax25,netrom,ddp}[,...]] [--unix|-x] [--inet|--ip] [--ax25] [--ipx] [--netrom] [--ddp]

## NOTE
This program is obsolete. Replacement for netstat is netlist. Replacement for netstat -r is ip route. Replacement for netstat -i is ip -s link. Replacement for netstat -g is ip maddr.

## DESCRIPTION
Netstat prints information about the Linux networking subsystem. The type of information printed is controlled by the first argument, as follows:

### (none)
By default, netstat displays a list of open sockets. If you don't specify any address families, then the active sockets of all configured address families will be printed.

### --route , -r
Display the kernel routing tables.

### --groups , -g
Display multicast group membership information for IPv4 and IPv6.

### --interfaces=iface , -I=iface , -i
Display a table of all network interfaces, or the specified iface.

### --masquerade , -M
Display a list of masqueraded connections.

### --statistics , -s
Display summary statistics for each protocol.

## OPTIONS

### --verbose , -v
Tell the user what is going on by being verbose. Especially print some useful information about unconfigured address families.

### --numeric , -n
Show numerical addresses instead of trying to determine symbolic host, port or user names.

### --numeric-hosts
shows numerical host addresses but does not affect the resolution of port or user names.

### --numeric-ports
shows numerical port numbers but does not affect the resolution of host or user names.

### --numeric-users
shows numerical user IDs but does not affect the resolution of host or port names.

### --protocol=family , -A
Specifies the address families (perhaps better described as low level protocols) for which connections are to be shown. family is a comma (',') separated list of address family keywords like inet, unix, ipx, ax25, netrom, and ddp. This has the same effect as using the --inet, --unix (-x), --ipx, --ax25, --netrom, and --ddp options.

The address family inet includes raw, udp and tcp protocol sockets.

### -c, --continuous
This will cause netstat to print the selected information every second continuously.

### -e, --extend
Display additional information. Use this option twice for maximum detail.

### -o, --timers
Include information related to networking timers.

### -p, --program
Show the PID and name of the program to which each socket belongs.

### -l, --listening
Show only listening sockets. (These are omitted by default.)

### -a, --all
Show both listening and non-listening sockets. With the --interfaces option, show interfaces that are not marked

### -F
Print routing information from the FIB. (This is the default.)

### -C
Print routing information from the route cache.

### delay
Netstat will cycle printing through statistics every delay seconds. UP.

## OUTPUT

### Proto
The protocol (tcp, udp, raw) used by the socket.

### Recv-Q
The count of bytes not copied by the user program connected to this socket.

### Send-Q
The count of bytes not acknowledged by the remote host.

### Local Address
Address and port number of the local end of the socket. Unless the --numeric (-n) option is specified, the socket address is resolved to its canonical host name (FQDN), and the port number is translated into the corresponding service name.

### Foreign Address
Address and port number of the remote end of the socket. Analogous to "Local Address."

### State
The state of the socket. Since there are no states in raw mode and usually no states used in UDP, this column may be left blank. Normally this can be one of several values:

ESTABLISHED

The socket has an established connection.

SYN_SENT

The socket is actively attempting to establish a connection.

SYN_RECV

A connection request has been received from the network.

FIN_WAIT1

The socket is closed, and the connection is shutting down.

FIN_WAIT2

Connection is closed, and the socket is waiting for a shutdown from the remote end.

TIME_WAIT

The socket is waiting after close to handle packets still in the network.

CLOSED

The socket is not being used.

CLOSE_WAIT

The remote end has shut down, waiting for the socket to close.

LAST_ACK

The remote end has shut down, and the socket is closed. Waiting for acknowledgement.

LISTEN

The socket is listening for incoming connections. Such sockets are not included in the output unless you specify the --listening (-l) or --all (-a) option.

CLOSING

Both sockets are shut down but we still don't have all our data sent.

UNKNOWN

The state of the socket is unknown.

### User
The username or the user id (UID) of the owner of the socket.

### PID/Program name
Slash-separated pair of the process id (PID) and process name of the process that owns the socket. --program causes this column to be included. You will also need superuser privileges to see this information on sockets you don't own. This identification information is not yet available for IPX sockets.

### Timer
(this needs to be written)

### Proto
The protocol (usually unix) used by the socket.

### RefCnt
The reference count (i.e. attached processes via this socket).

### Flags
The flags displayed is SO_ACCEPTON (displayed as ACC), SO_WAITDATA (W) or SO_NOSPACE (N). SO_ACCECPTON is used on unconnected sockets if their corresponding processes are waiting for a connect request. The other flags are not of normal interest.

### Type
There are several types of socket access:

SOCK_DGRAM

The socket is used in Datagram (connectionless) mode.

SOCK_STREAM

This is a stream (connection) socket.

SOCK_RAW

The socket is used as a raw socket.

SOCK_RDM

This one serves reliably-delivered messages.

SOCK_SEQPACKET

This is a sequential packet socket.

SOCK_PACKET

Raw interface access socket.

UNKNOWN

Who ever knows what the future will bring us - just fill in here :-)

### State
This field will contain one of the following Keywords:

FREE

The socket is not allocated

LISTENING

The socket is listening for a connection request. Such sockets are only included in the output if you specify the --listening (-l) or --all (-a) option.

CONNECTING

The socket is about to establish a connection.

CONNECTED

The socket is connected.

DISCONNECTING

The socket is disconnecting.

(empty)

The socket is not connected to another one.

UNKNOWN

This state should never happen.

### PID/Program name
Process ID (PID) and process name of the process that has the socket open. More info available in Active Internet connections section written above.

### Path
This is the path name as which the corresponding processes attached to the socket.

### Active IPX sockets
(this needs to be done by somebody who knows it)

### Active NET/ROM sockets
(this needs to be done by somebody who knows it)

### Active AX.25 sockets
(this needs to be done by somebody who knows it)

## NOTES
Starting with Linux release 2.2 netstat -i does not show interface statistics for alias interfaces. To get per alias interface counters you need to setup explicit rules using the ipchains(8) command.

## FILES
/etc/services -- The services translation file

/proc -- Mount point for the proc filesystem, which gives access to kernel status information via the following files.

/proc/net/dev -- device information

/proc/net/raw -- raw socket information

/proc/net/tcp -- TCP socket information

/proc/net/udp -- UDP socket information

/proc/net/igmp -- IGMP multicast information

/proc/net/unix -- Unix domain socket information

/proc/net/ipx -- IPX socket information

/proc/net/ax25 -- AX25 socket information

/proc/net/appletalk -- DDP (appletalk) socket information

/proc/net/nr -- NET/ROM socket information

/proc/net/route -- IP routing information

/proc/net/ax25_route -- AX25 routing information

/proc/net/ipx_route -- IPX routing information

/proc/net/nr_nodes -- NET/ROM nodelist

/proc/net/nr_neigh -- NET/ROM neighbours

/proc/net/ip_masquerade -- masqueraded connections

/proc/net/snmp -- statistics

## SEE ALSO
netlist(1),ip(8)

## BUGS
Occasionally strange information may appear if a socket changes as it is viewed. This is unlikely to occur.

## AUTHORS
The netstat user interface was written by Fred Baumgarten <dc6iq@insu1.etec.uni-karlsruhe.de> the man page basically by Matt Welsh <mdw@tc.cornell.edu>. It was updated by Alan Cox <Alan.Cox@linux.org> but could do with a bit more work. It was updated again by Tuan Hoang <tqhoang@bigfoot.com>.

The man page and the command included in the net-tools package is totally rewritten by Bernd Eckenfels <ecki@linux.de>.


plipconfig

title: plipconfig(8)

summary: fine tune PLIP device parameters

text:
# plipconfig(8)

## NAME
plipconfig - fine tune PLIP device parameters

## SYNOPSIS
plipconfig interface

plipconfig interface [nibble NN] [trigger NN] [unit NN]

## DESCRIPTION
Plipconfig is used to (hopefully) improve PLIP performance by changing the default timing parameters used by the PLIP protocol. Results are dependent on the parallel port hardware, cable, and the CPU speed of each machine on each end of the PLIP link.

If the single interface argument is given, plipconfig displays the status of the given interface only. Otherwise, it will try to set the options.

## OPTIONS
nibble NN

Sets the nibble wait value in microseconds. Default is 3000.

trigger NN

Sets the trigger wait value in microseconds. Default is 500.

PLIP speed can in some cases be improved by lowering the default values. Values which are too low may cause excess use of CPU, poor interrupt response time resulting in serial ports dropping characters, or in dropping of PLIP packets. Changing the plip MTU can also affect PLIP speed.

## NOTE
If you get no response it is far more likely the irq is wrong and needs setting with ifconfig. The few cases where the default parameters will be too fast are those using very long cables. Something you should never do as the parallel port is not specified or designed for driving long cable runs.

## SEE ALSO
ifconfig(8)

## BUGS
Non.

## AUTHOR
John Paul Morrison, <jmorriso@bogomips.ee.ubc.ca>, <ve7jpm@ve7jpm.ampr.org>


route

title: route(8)

summary: show / manipulate the IP routing table

text:
# route(8)

## NAME
route - show / manipulate the IP routing table

## SYNOPSIS
route [-CFvnee]

route

[-v] [-A family] add [-net|-host] target [netmask Nm] [gw Gw] [metric N] [mss M] [window W] [irtt I] [reject] [mod] [dyn] [reinstate] [[dev] If]

route

[-v] [-A family] del [-net|-host] target [gw Gw] [netmask Nm] [metric N] [[dev] If]

route

[-V] [--version] [-h] [--help]

## NOTE
This program is obsolete. For replacement check ip route.

## DESCRIPTION
Route manipulates the kernel's IP routing tables. Its primary use is to set up static routes to specific hosts or networks via an interface after it has been configured with the ifconfig(8) program.

When the add or del options are used, route modifies the routing tables. Without these options, route displays the current contents of the routing tables.

## OPTIONS
-A family

use the specified address family (eg `inet'; use `route --help' for a full list).

-F

operate on the kernel's FIB (Forwarding Information Base) routing table. This is the default.

-C

operate on the kernel's routing cache.

-v

select verbose operation.

-n

show numerical addresses instead of trying to determine symbolic host names. This is useful if you are trying to determine why the route to your nameserver has vanished.

-e

use netstat(8)-format for displaying the routing table. -ee will generate a very long line with all parameters from the routing table.

del

delete a route.

add

add a new route.

target

the destination network or host. You can provide IP addresses in dotted decimal or host/network names.

-net

the target is a network.

-host

the target is a host.

netmask NM

when adding a network route, the netmask to be used.

gw GW

route packets via a gateway. NOTE: The specified gateway must be reachable first. This usually means that you have to set up a static route to the gateway beforehand. If you specify the address of one of your local interfaces, it will be used to decide about the interface to which the packets should be routed to. This is a BSDism compatibility hack.

metric M

set the metric field in the routing table (used by routing daemons) to M.

mss M

set the TCP Maximum Segment Size (MSS) for connections over this route to M bytes. The default is the device MTU minus headers, or a lower MTU when path mtu discovery occured. This setting can be used to force smaller TCP packets on the other end when path mtu discovery does not work (usually because of misconfigured firewalls that block ICMP Fragmentation Needed)

window W

set the TCP window size for connections over this route to W bytes. This is typically only used on AX.25 networks and with drivers unable to handle back to back frames.

irtt I

set the initial round trip time (irtt) for TCP connections over this route to I milliseconds (1-12000). This is typically only used on AX.25 networks. If omitted the RFC 1122 default of 300ms is used.

reject

install a blocking route, which will force a route lookup to fail. This is for example used to mask out networks before using the default route. This is NOT for firewalling.

mod, dyn, reinstate

install a dynamic or modified route. These flags are for diagnostic purposes, and are generally only set by routing daemons.

dev If

force the route to be associated with the specified device, as the kernel will otherwise try to determine the device on its own (by checking already existing routes and device specifications, and where the route is added to). In most normal networks you won't need this. If dev If is the last option on the command line, the word dev may be omitted, as it's the default. Otherwise the order of the route modifiers (metric - netmask - gw - dev) doesn't matter.

## EXAMPLES
route add -net 127.0.0.0

adds the normal loopback entry, using netmask 255.0.0.0 (class A net, determined from the destination address) and associated with the "lo" device (assuming this device was prviously set up correctly with ifconfig(8)).

route add -net 192.56.76.0 netmask 255.255.255.0 dev eth0

adds a route to the network 192.56.76.x via "eth0". The Class C netmask modifier is not really necessary here because 192.* is a Class C IP address. The word "dev" can be omitted here.

route add default gw mango-gw

adds a default route (which will be used if no other route matches). All packets using this route will be gatewayed through "mango-gw". The device which will actually be used for that route depends on how we can reach "mango-gw" - the static route to "mango-gw" will have to be set up before.

route add ipx4 sl0

Adds the route to the "ipx4" host via the SLIP interface (assuming that "ipx4" is the SLIP host).

route add -net 192.57.66.0 netmask 255.255.255.0 gw ipx4

This command adds the net "192.57.66.x" to be gatewayed through the former route to the SLIP interface.

route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0

This is an obscure one documented so people know how to do it. This sets all of the class D (multicast) IP routes to go via "eth0". This is the correct normal configuration line with a multicasting kernel.

route add -net 10.0.0.0 netmask 255.0.0.0 reject

This installs a rejecting route for the private network "10.x.x.x."

## OUTPUT
The output of the kernel routing table is organized in the following columns

Destination

The destination network or destination host.

Gateway

The gateway address or '*' if none set.

Genmask

The netmask for the destination net; '255.255.255.255' for a host destination and '0.0.0.0' for the default route.

Flags

Possible flags include

U (route is up)

H (target is a host)

G (use gateway)

R (reinstate route for dynamic routing)

D (dynamically installed by daemon or redirect)

M (modified from routing daemon or redirect)

A (installed by addrconf)

C (cache entry)

! (reject route)

Metric

The 'distance' to the target (usually counted in hops). It is not used by recent kernels, but may be needed by routing daemons.

Ref

Number of references to this route. (Not used in the Linux kernel.)

Use

Count of lookups for the route. Depending on the use of -F and -C this will be either route cache misses (-F) or hits (-C).

Iface

Interface to which packets for this route will be sent.

MSS

Default maximum segement size for TCP connections over this route.

Window

Default window size for TCP connections over this route.

irtt

Initial RTT (Round Trip Time). The kernel uses this to guess about the best TCP protocol parameters without waiting on (possibly slow) answers.

HH (cached only)

The number of ARP entries and cached routes that refer to the hardware header cache for the cached route. This will be -1 if a hardware address is not needed for the interface of the cached route (e.g. lo).

Arp (cached only)

Whether or not the hardware address for the cached route is up to date.

## FILES
/proc/net/ipv6_route

/proc/net/route

/proc/net/rt_cache

## SEE ALSO
ip(8)

## HISTORY
Route for Linux was originally written by Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> and then modified by Johannes Stille and Linus Torvalds for pl15. Alan Cox added the mss and window options for Linux 1.1.22. irtt support and merged with netstat from Bernd Eckenfels.

## AUTHOR
Currently maintained by Phil Blundell <Philip.Blundell@pobox.com>.