.TH IP 3.SH NAMEip, esp, gre, icmp, icmpv6, ipmux, rudp, tcp, udp \- network protocols over IP.SH SYNOPSIS.nf.2C.B bind -a #I\fIspec\fP /net.sp 0.3v.B /net/ipifc.B /net/ipifc/clone.B /net/ipifc/stats.BI /net/ipifc/ n.BI /net/ipifc/ n /status.BI /net/ipifc/ n /ctl\&....sp 0.3v.B /net/arp.B /net/bootp.B /net/iproute.B /net/ipselftab.B /net/log.B /net/ndb.sp 0.3v.B /net/esp.B /net/gre.B /net/icmp.B /net/icmpv6.B /net/ipmux.B /net/rudp.B /net/tcp.B /net/udp.sp 0.3v.B /net/tcp/clone.B /net/tcp/stats.BI /net/tcp/ n.BI /net/tcp/ n /data.BI /net/tcp/ n /ctl.BI /net/tcp/ n /local.BI /net/tcp/ n /remote.BI /net/tcp/ n /status.BI /net/tcp/ n /listen\&....1C.fi.SH DESCRIPTIONThe.I ipdevice provides the interface to Internet Protocol stacks..I Specis an integer from 0 to 15 identifying a stack.Each stack implements IPv4 and IPv6.Each stack is independent of all others:the only information transfer between them is via programs thatmount multiple stacks.Normally a system uses only one stack.However multiple stacks can be used for debuggingnew IP networks or implementing firewalls or proxyservices..PPAll addresses used are 16-byte IPv6 addresses.IPv4 addresses are a subset of the IPv6 addresses and both standard.SM ASCIIformats are accepted.In binary representation, all v4 addresses start with the 12 bytes, in hex:.IP.EX00 00 00 00 00 00 00 00 00 00 ff ff.EE..SS "Configuring interfacesEach stack may have multiple interfaces and each interfacemay have multiple addresses.The.B /net/ipifcdirectory contains a.B clonefile, a.B statsfile, and numbered subdirectories for each physical interface..PPOpening the.B clonefile reserves an interface.The file descriptor returned from the.IR open (2)will point to the control file,.BR ctl ,of the newly allocated interface.Reading.B ctlreturns a text string representing the number of the interface.Writing.B ctlalters aspects of the interface.The possible.I ctlmessages are those described under.B "Protocol directories"below and these:.TF "\fLbind loopback\fR".PD..\" from devip.c..TP.BI "bind ether " pathTreat the device mounted at.I pathas an Ethernet medium carrying IP and ARP packetsand associate it with this interface.The kernel will.IR dial (2).IR path !0x800and.IR path !0x806and use the two connections for IPv4 andARP respectively..TP.B "bind pktTreat this interface as a packet interface. Assumea user program will read and write the.I datafile to receive and transmit IP packets to the kernel.This is used by programs such as.IR ppp (8)to mediate IP packet transfer between the kernel anda PPP encoded device..TP.BI "bind netdev " pathTreat this interface as a packet interface.The kernel will open.I pathand read and write the resulting file descriptorto receive and transmit IP packets..TP.BI "bind loopback "Treat this interface as a local loopback. Anythingwritten to it will be looped back...\" from ipifc.c..TP.B "unbindDisassociate the physical device from an IP interface..TP.BI add\ "local mask remote mtu " proxy.PD 0.TP.BI try\ "local mask remote mtu " proxy.PDAdd a local IP address to the interface..I Tryadds the.I localaddress as a tentative addressif it's an IPv6 address.The.IR mask ,.IR remote ,.IR mtu ,and.B proxyarguments are all optional.The default.I maskis the class mask for the local address.The default.I remoteaddress is.I localANDed with.IR mask .The default.I mtu(maximum transmission unit)is 1514 for Ethernet and 4096 for packet media.The.I mtuis the size in bytes of the largest packet that this interface can send..IR Proxy ,if specified, means that this machine should answerARP requests for the remote address..IR Ppp (8)does this to make remote machines appearto be connected to the local Ethernet..TP.BI remove\ "local mask"Remove a local IP address from an interface..TP.BI mtu\ nSet the maximum transfer unit for this device to.IR n .The mtu is the maximum size of the packet including anymedium-specific headers..TP.BI reassembleReassemble IP fragments before forwarding to this interface.TP.BI iprouting\ nAllow.RI ( nis missing or non-zero) or disallow.RI ( nis 0) forwarding packets between this interface andothers...\" remainder from netif.c (thus called from devether.c),.\" except add6 and ra6 from ipifc.c..TP.B bridgeEnable bridging (see.IR bridge (3))..TP.B promiscuousSet the interface into promiscuous mode,which makes it accept all incoming packets,whether addressed to it or not..TP.BI "connect " typemarks the Ethernet packet.I typeas being in use, if not already in useon this interface.A.I typeof -1 means `all' but appears to be a no-op..TP.BI addmulti\ Media-addrTreat the multicast.I Media-addron this interface as a local address..TP.BI remmulti\ Media-addrRemove the multicast address.I Media-addrfrom this interface..TP.B scanbsMake the wireless interface scan for base stations..TP.B headersonlySet the interface to pass only packet headers, not data too...\" remainder from ipifc.c; tedious, so put them last..TP.BI "add6 " "v6addr pfx-len [onlink auto validlt preflt]"Add the local IPv6 address.I v6addrwith prefix length.I pfx-lento this interface.See RFC 2461 §6.2.1 for more detail.The remaining arguments are optional:.RS.TF "\fIonlink\fR".TP.I onlinkflag: address is `on-link'.TP.I autoflag: autonomous.TP.I validltvalid life-time in seconds.TP.I prefltpreferred life-time in seconds.RE.PD.TP.BI "ra6 " "keyword value ..."Set IPv6 router advertisement (RA) parameter.IR keyword 's.IR value .Known.IR keyword sand the meanings of their values follow.See RFC 2461 §6.2.1 for more detail.Flags are true iff non-zero..RS.TF "\fLreachtime\fR".TP.B recvraflag: receive and process RAs..TP.B sendraflag: generate and send RAs..TP.B mflagflag: ``Managed address configuration'',goes into RAs..TP.B oflagflag: ``Other stateful configuration'',goes into RAs..TP.B maxraint``maximum time allowed between sending unsolicited multicast''RAs from the interface, in ms..TP.B minraint``minimum time allowed between sending unsolicited multicast''RAs from the interface, in ms..TP.B linkmtu``value to be placed in MTU options sent by the router.''Zero indicates none..TP.B reachtimesets the Reachable Time field in RAs sent by the router.``Zero means unspecified (by this router).''.TP.B rxmitrasets the Retrans Timer field in RAs sent by the router.``Zero means unspecified (by this router).''.TP.B ttldefault value of the Cur Hop Limit field in RAs sent by the router.Should be set to the ``current diameter of the Internet.''``Zero means unspecified (by this router).''.TP.B routerltsets the Router Lifetime field of RAs sent from the interface, in ms.Zero means the router is not to be used as a default router..PD.RE.PPReading the interface's.I statusfile returns information about the interface, one line for eachlocal address on that interface. The first linehas 9 white-space-separated fields: device, mtu, local address,mask, remote or network address, packets in, packets out, input errors,output errors. Each subsequent line contains all but the device and mtu.See.I readipifcin.IR ip (2)...SS "RoutingThe file.I iproutecontrols information about IP routing.When read, it returns one line per routing entry.Each line contains six white-space-separated fields:target address, target mask, address of next hop, flags,tag, and interface number.The entry used for routing an IP packet is the one withthe longest mask for which destination address ANDed withtarget mask equals the target address.The one-character flags are:.TF m.TP.B 4IPv4 route.TP.B 6IPv6 route.TP.B ilocal interface.TP.B bbroadcast address.TP.B ulocal unicast address.TP.B mmulticast route.TP.B ppoint-to-point route.PD.PPThe tag is an arbitrary, up to 4 character, string. It is normally used toindicate what routing protocol originated the route..PPWriting to.B /net/iproutechanges the route table. The messages are:.TF "\fLtag \fIstring\fR".PD.TP.B flushRemove all routes..TP.BI tag\ stringAssociate the tag,.IR string ,with all subsequent routes added via this file descriptor..TP.BI add\ "target mask nexthop"Add the route to the table. If one already exists with thesame target and mask, replace it..TP.BI remove\ "target mask"Remove a route with a matching target and mask...SS "Address resolutionThe file.B /net/arpcontrols information about address resolution.The kernel automatically updates the v4 ARP and v6 Neighbour Discoveryinformation for Ethernet interfaces.When read, the file returns one line per address containing thetype of medium, the status of the entry (OK, WAIT), the IPaddress, and the medium address.Writing to.B /net/arpadministers the ARP information.The control messages are:.TF "\fLdel \fIIP-addr\fR".PD.TP.B flushRemove all entries..TP.BI add\ "type IP-addr Media-addr"Add an entry or replace an existing one for thesame IP address..TP.BI del\ "IP-addr"Delete an individual entry..PPARP entries do not time out. The ARP table is acache with an LRU replacement policy. The IP stacklistens for all ARP requests and, if the requester is inthe table, the entry is updated.Also, whenever a new address is configured onto anEthernet, an ARP request is sent to helpupdate the table on other systems..PPCurrently, the only medium type is.BR ether ..br.ne 3..SS "Debugging and stack informationIf any process is holding.B /net/logopen, the IP stack queues debugging information to it.This is intended primarily for debugging the IP stack.The information provided is implementation-defined;see the source for details. Generally, what is returned is error messagesabout bad packets..PPWriting to.B /net/logcontrols debugging. The control messages are:.TF "\fLclear \fIarglist\fR".PD.TP.BI set\ arglist.I Arglistis a space-separated list of items for which to enable debugging.The possible items are:.BR ppp ,.BR ip ,.BR fs ,.BR tcp ,.BR icmp ,.BR udp ,.BR compress ,.BR gre ,.BR tcpwin ,.BR tcprxmt ,.BR udpmsg ,.BR ipmsg ,and.BR esp ..TP.BI clear\ arglist.I Arglistis a space-separated list of items for which to disable debugging..TP.BI only\ addrIf.I addris non-zero, restrict debugging to only thosepackets whose source or destination is thataddress..PPThe file.B /net/ndbcan be read or written byprograms. It is normally used by.IR ipconfig (8)to leave configuration information for other programssuch as.B dnsand.B cs(see.IR ndb (8))..B /net/ndbmay contain up to 1024 bytes..PPLines 1–500 of 1269. Load more
.TH IP 3 .SH NAME ip, esp, gre, icmp, icmpv6, ipmux, rudp, tcp, udp \- network protocols over IP .SH SYNOPSIS .nf .2C .B bind -a #I\fIspec\fP /net .sp 0.3v .B /net/ipifc .B /net/ipifc/clone .B /net/ipifc/stats .BI /net/ipifc/ n .BI /net/ipifc/ n /status .BI /net/ipifc/ n /ctl \&... .sp 0.3v .B /net/arp .B /net/bootp .B /net/iproute .B /net/ipselftab .B /net/log .B /net/ndb .sp 0.3v .B /net/esp .B /net/gre .B /net/icmp .B /net/icmpv6 .B /net/ipmux .B /net/rudp .B /net/tcp .B /net/udp .sp 0.3v .B /net/tcp/clone .B /net/tcp/stats .BI /net/tcp/ n .BI /net/tcp/ n /data .BI /net/tcp/ n /ctl .BI /net/tcp/ n /local .BI /net/tcp/ n /remote .BI /net/tcp/ n /status .BI /net/tcp/ n /listen \&... .1C .fi .SH DESCRIPTION The .I ip device provides the interface to Internet Protocol stacks. .I Spec is an integer from 0 to 15 identifying a stack. Each stack implements IPv4 and IPv6. Each stack is independent of all others: the only information transfer between them is via programs that mount multiple stacks. Normally a system uses only one stack. However multiple stacks can be used for debugging new IP networks or implementing firewalls or proxy services. .PP All addresses used are 16-byte IPv6 addresses. IPv4 addresses are a subset of the IPv6 addresses and both standard .SM ASCII formats are accepted. In binary representation, all v4 addresses start with the 12 bytes, in hex: .IP .EX 00 00 00 00 00 00 00 00 00 00 ff ff .EE . .SS "Configuring interfaces Each stack may have multiple interfaces and each interface may have multiple addresses. The .B /net/ipifc directory contains a .B clone file, a .B stats file, and numbered subdirectories for each physical interface. .PP Opening the .B clone file reserves an interface. The file descriptor returned from the .IR open (2) will point to the control file, .BR ctl , of the newly allocated interface. Reading .B ctl returns a text string representing the number of the interface. Writing .B ctl alters aspects of the interface. The possible .I ctl messages are those described under .B "Protocol directories" below and these: .TF "\fLbind loopback\fR" .PD . .\" from devip.c . .TP .BI "bind ether " path Treat the device mounted at .I path as an Ethernet medium carrying IP and ARP packets and associate it with this interface. The kernel will .IR dial (2) .IR path !0x800 and .IR path !0x806 and use the two connections for IPv4 and ARP respectively. .TP .B "bind pkt Treat this interface as a packet interface. Assume a user program will read and write the .I data file to receive and transmit IP packets to the kernel. This is used by programs such as .IR ppp (8) to mediate IP packet transfer between the kernel and a PPP encoded device. .TP .BI "bind netdev " path Treat this interface as a packet interface. The kernel will open .I path and read and write the resulting file descriptor to receive and transmit IP packets. .TP .BI "bind loopback " Treat this interface as a local loopback. Anything written to it will be looped back. . .\" from ipifc.c . .TP .B "unbind Disassociate the physical device from an IP interface. .TP .BI add\ "local mask remote mtu " proxy .PD 0 .TP .BI try\ "local mask remote mtu " proxy .PD Add a local IP address to the interface. .I Try adds the .I local address as a tentative address if it's an IPv6 address. The .IR mask , .IR remote , .IR mtu , and .B proxy arguments are all optional. The default .I mask is the class mask for the local address. The default .I remote address is .I local ANDed with .IR mask . The default .I mtu (maximum transmission unit) is 1514 for Ethernet and 4096 for packet media. The .I mtu is the size in bytes of the largest packet that this interface can send. .IR Proxy , if specified, means that this machine should answer ARP requests for the remote address. .IR Ppp (8) does this to make remote machines appear to be connected to the local Ethernet. .TP .BI remove\ "local mask" Remove a local IP address from an interface. .TP .BI mtu\ n Set the maximum transfer unit for this device to .IR n . The mtu is the maximum size of the packet including any medium-specific headers. .TP .BI reassemble Reassemble IP fragments before forwarding to this interface .TP .BI iprouting\ n Allow .RI ( n is missing or non-zero) or disallow .RI ( n is 0) forwarding packets between this interface and others. . .\" remainder from netif.c (thus called from devether.c), .\" except add6 and ra6 from ipifc.c . .TP .B bridge Enable bridging (see .IR bridge (3)). .TP .B promiscuous Set the interface into promiscuous mode, which makes it accept all incoming packets, whether addressed to it or not. .TP .BI "connect " type marks the Ethernet packet .I type as being in use, if not already in use on this interface. A .I type of -1 means `all' but appears to be a no-op. .TP .BI addmulti\ Media-addr Treat the multicast .I Media-addr on this interface as a local address. .TP .BI remmulti\ Media-addr Remove the multicast address .I Media-addr from this interface. .TP .B scanbs Make the wireless interface scan for base stations. .TP .B headersonly Set the interface to pass only packet headers, not data too. . .\" remainder from ipifc.c; tedious, so put them last . .TP .BI "add6 " "v6addr pfx-len [onlink auto validlt preflt]" Add the local IPv6 address .I v6addr with prefix length .I pfx-len to this interface. See RFC 2461 §6.2.1 for more detail. The remaining arguments are optional: .RS .TF "\fIonlink\fR" .TP .I onlink flag: address is `on-link' .TP .I auto flag: autonomous .TP .I validlt valid life-time in seconds .TP .I preflt preferred life-time in seconds .RE .PD .TP .BI "ra6 " "keyword value ..." Set IPv6 router advertisement (RA) parameter .IR keyword 's .IR value . Known .IR keyword s and the meanings of their values follow. See RFC 2461 §6.2.1 for more detail. Flags are true iff non-zero. .RS .TF "\fLreachtime\fR" .TP .B recvra flag: receive and process RAs. .TP .B sendra flag: generate and send RAs. .TP .B mflag flag: ``Managed address configuration'', goes into RAs. .TP .B oflag flag: ``Other stateful configuration'', goes into RAs. .TP .B maxraint ``maximum time allowed between sending unsolicited multicast'' RAs from the interface, in ms. .TP .B minraint ``minimum time allowed between sending unsolicited multicast'' RAs from the interface, in ms. .TP .B linkmtu ``value to be placed in MTU options sent by the router.'' Zero indicates none. .TP .B reachtime sets the Reachable Time field in RAs sent by the router. ``Zero means unspecified (by this router).'' .TP .B rxmitra sets the Retrans Timer field in RAs sent by the router. ``Zero means unspecified (by this router).'' .TP .B ttl default value of the Cur Hop Limit field in RAs sent by the router. Should be set to the ``current diameter of the Internet.'' ``Zero means unspecified (by this router).'' .TP .B routerlt sets the Router Lifetime field of RAs sent from the interface, in ms. Zero means the router is not to be used as a default router. .PD .RE .PP Reading the interface's .I status file returns information about the interface, one line for each local address on that interface. The first line has 9 white-space-separated fields: device, mtu, local address, mask, remote or network address, packets in, packets out, input errors, output errors. Each subsequent line contains all but the device and mtu. See .I readipifc in .IR ip (2). . .SS "Routing The file .I iproute controls information about IP routing. When read, it returns one line per routing entry. Each line contains six white-space-separated fields: target address, target mask, address of next hop, flags, tag, and interface number. The entry used for routing an IP packet is the one with the longest mask for which destination address ANDed with target mask equals the target address. The one-character flags are: .TF m .TP .B 4 IPv4 route .TP .B 6 IPv6 route .TP .B i local interface .TP .B b broadcast address .TP .B u local unicast address .TP .B m multicast route .TP .B p point-to-point route .PD .PP The tag is an arbitrary, up to 4 character, string. It is normally used to indicate what routing protocol originated the route. .PP Writing to .B /net/iproute changes the route table. The messages are: .TF "\fLtag \fIstring\fR" .PD .TP .B flush Remove all routes. .TP .BI tag\ string Associate the tag, .IR string , with all subsequent routes added via this file descriptor. .TP .BI add\ "target mask nexthop" Add the route to the table. If one already exists with the same target and mask, replace it. .TP .BI remove\ "target mask" Remove a route with a matching target and mask. . .SS "Address resolution The file .B /net/arp controls information about address resolution. The kernel automatically updates the v4 ARP and v6 Neighbour Discovery information for Ethernet interfaces. When read, the file returns one line per address containing the type of medium, the status of the entry (OK, WAIT), the IP address, and the medium address. Writing to .B /net/arp administers the ARP information. The control messages are: .TF "\fLdel \fIIP-addr\fR" .PD .TP .B flush Remove all entries. .TP .BI add\ "type IP-addr Media-addr" Add an entry or replace an existing one for the same IP address. .TP .BI del\ "IP-addr" Delete an individual entry. .PP ARP entries do not time out. The ARP table is a cache with an LRU replacement policy. The IP stack listens for all ARP requests and, if the requester is in the table, the entry is updated. Also, whenever a new address is configured onto an Ethernet, an ARP request is sent to help update the table on other systems. .PP Currently, the only medium type is .BR ether . .br .ne 3 . .SS "Debugging and stack information If any process is holding .B /net/log open, the IP stack queues debugging information to it. This is intended primarily for debugging the IP stack. The information provided is implementation-defined; see the source for details. Generally, what is returned is error messages about bad packets. .PP Writing to .B /net/log controls debugging. The control messages are: .TF "\fLclear \fIarglist\fR" .PD .TP .BI set\ arglist .I Arglist is a space-separated list of items for which to enable debugging. The possible items are: .BR ppp , .BR ip , .BR fs , .BR tcp , .BR icmp , .BR udp , .BR compress , .BR gre , .BR tcpwin , .BR tcprxmt , .BR udpmsg , .BR ipmsg , and .BR esp . .TP .BI clear\ arglist .I Arglist is a space-separated list of items for which to disable debugging. .TP .BI only\ addr If .I addr is non-zero, restrict debugging to only those packets whose source or destination is that address. .PP The file .B /net/ndb can be read or written by programs. It is normally used by .IR ipconfig (8) to leave configuration information for other programs such as .B dns and .B cs (see .IR ndb (8)). .B /net/ndb may contain up to 1024 bytes. .PP