1269 lines · 27.0 KB · Text
RawDownload
.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..PP

Lines 1–500 of 1269.