395 lines · 8.1 KB · Text
RawDownload
.TH IPCONFIG 8.SH NAMEipconfig, rip, linklocal, ipv6on \- Internet configuration and routing.SH SYNOPSIS.in +0.25i.ti -0.25i.B ip/ipconfig.RB [ -6DGNOPdnpruX ].RB [ -b.IR baud ].RB [ -c.IR ctl ].RB [ -g.IR gateway ].RB [ -h.IR host ].RB [ -m.IR mtu ].RB [ -o.IR dhcp-opt ].RB [ -x.IR netmtpt ][.I type[.I device]\|].RI [ verb ][.I local[.I mask[.I remote[.I file-server[.I auth]\|]\|]\|]\|].PP.B ip/rip.RB [ -bdr ].RB [ -x.IR netmtpt ].PP.B ip/linklocal[.B -t.I gwipv4].I mac\&....PP.B ipv6on[.I netmtpt.I ndbfile[.I gwipv4]\|].SH DESCRIPTION.I Ipconfigbinds a device interface (default.BR /net/ether0 )to a mounted IP stack (default.BR /net )and configures the interface with a local address and optionallya mask, a remote address, a file server and an authentication server address.The addresses can be specified in the command line or obtained via DHCP.If DHCP is requested, it will also obtain the addresses of DNSservers, NTP servers, gateways, a Plan 9 file server,and a Plan 9 authentication server.If this is the first non-loopbackinterface on the IP stack, the information will be written to.B /net/ndbin the form of an.IR ndb (8)entry..PP.I Typemay be.BR ether ,.BR gbe ,.BR ppp ,.BR pkt ,or.BR loopback .The.B gbetype is equivalent to.B etherexcept that it allows jumbo packets (up to ~9KB).The.B pktinterface passes all IP packets to and from a user program.For.B pppthe device can be any byte stream device..PPThe verb (default.IR add )determines the action performed.  The usual verbs are:.TF remove.TP.B addif the device is not bound to the IP stack, bind it.Add the given local address, mask, and remote address to the interface.An interface may have multiple addresses..TP.B removeremove the address from the device interface..TP.B unbindunbind the device interface and all its addresses from theIP stack..PD.PPThe IPv6-specific verbs, which take different arguments, are:.TP.BI "add6 " "prefix pfx-len onlink auto validlt preflt"sets the named IPv6 parameters; see.IR ip (3)for more detail..TP.BI "ra6 " "[ keyword value ] ..."sets IPv6 router advertisement parameter.IR keyword 's.IR value .See.IR ip (3)for more detail.Setting.I recvranon-zero also forks a process toreceive and process router advertisements.Setting.I sendranon-zero alsoenables IP routing on the interface,forks a process to send router advertisements,and if no.I recvraprocess is running, forks one..PD.PPThe options are:.TF M.PD.TP.B 6if adding an address (the default action),add the IPv6 link-local address..TP.B bthe baud rate to use on a serial linewhen configuring.BR PPP ..TP.B cwrite the control string.I ctlto the ethernet device control file before starting to configure it.May be repeated to specify multiple control writes..TP.B duse DHCP to determine any unspecified configuration parameters..TP.B Dturn on debugging..TP.B gthe default gateway..TP.B Guse only generic DHCP options.  Without this option,.I ipconfigadds to requests a Vendor Class option with value.BI plan9_$ cputypeand also requests vendor specific options 128 and 129 which weinterpret as the Plan 9 file server and auth server.Replies to these options contain a list of IP addresses for possiblefile servers and auth servers..TP.B hthe hostname to add to DHCP requests.  Some DHCPservers, such as the one used by Comcast, will not respondunless a correct hostname is in the request..TP.B mthe maximum IP packet size to use on this interface..TP.B ndetermine parameters but don't configure the interface..TP.B Nlook in.B /lib/ndbfor the IP parameters.  This only works if theinterface is an ethernet.  It uses the ethernet address to finda matching entry..TP.B Oaddresses specified on the command line override those obtained via DHCP.A command line address of 0 implies no override..TP.B pwrite configuration information to.BR /net/ndb ,even if other network interfaces are already configured.TP.B Pdo not write configuration information to.BR /net/ndb ,even if this is the first network interface to be configured.TP.B rby default,.I ipconfigexits after trying DHCP for 15 seconds with no answer.This option directs.I ipconfiginstead to fork a background process that keeps trying forever..TP.B udisable IPv6 duplicate discovery detection,which removes any existing ARP table entry for one of our IPv6 addressesbefore adding new ones..TP.B xuse the IP stack mounted at.I netmtptinstead of at.BR /net ..TP.B Xdon't fork a process to keep the DHCP lease alive..TP.B oadds.I dhcpoptionto the list of paramters requested of the DHCP server.  Theresult will appear in.B /net/ndbshould this be the first interface.  The known options are:.RS.LP.ft Larptimeout, baddr, bflen, bootfile, clientid, cookie, discovermask,discoverrouter, dns, dom, dumpfile, etherencap, extpath, finger,homeagent, impress, ipaddr, ipforward, ipgw, ipmask, irc, lease, log,lpr, maxdatagram, maxmsg, message, mtu, name, netbiosdds, netbiosns,netbiosscope, netbiostype, ni, nisdomain, nisplus, nisplusdomain,nntp, nonlocal, ntp, overload, params, pathplateau, pathtimeout,policyfilter, pop3, rebindingtime, renewaltime, rl, rootpath, rs,serverid, smtp, st, staticroutes, stdar, subnetslocal, supplymask,swap, sys, tcpka, tcpkag, tcpttl, tftp, time, timeoff, trailerencap,ttl, type, vendorclass, www, xdispmanager, xfont.RE.IPThe options.BR ipmask ,.BR ipgw ,.BR dns ,.BR sys ,and.B ntpare always requested..TF M.PD.PPIf DHCP is requested, a process is forkedoff to renew the lease before itruns out.  If the lease does run out, thisprocess will remove any configured addressesfrom the interface..PP.I Ripruns the routing protocol RIP.It listens for RIP packets on connected networks andupdates the kernel routing tables.The options are:.TF M.PD.TP.B bbroadcasts routing information onto the networks..TP.B ngathers routing information but doesn't write to theroute table.  This is useful with.B \-dto debug a network..TP.B xuse the IP stack mounted at.I netmtptinstead of at.BR /net ..TP.B dturn on (voluminous) debugging..PP.I Linklocalprints the IPv6 EUI-64-based link-local address derived from the given.I macaddress.Given.BR -t ,.I linklocalinstead prints the.I 6to4EUI-64-based IPv6 address derived from.I macand.I 6to4gateway.IR gwipv4 ..PP.I Ipv6onuses the network database at.I ndbfileto configure the network mounted on.I netmtptwith a link-local address (derived from its MAC address)and attempts to add a default IPv6 route to the localIPv4 gateway's IPv6 address.If.I gwipv4is supplied, it will be used as the gateway's IPv4 address..SH EXAMPLESConfigure Ethernet 0 as the primary IP interface.Get all addresses via DHCP.  Start up a connection serverand DNS resolver for this IP stack..IP.EX% bind -b '#l0' /net% bind -a '#I0' /net% ip/ipconfig% ndb/cs% ndb/dns -r.EE.PPAdd a second address to the stack..IP.EX% ip/ipconfig ether /net/ether0 add 12.1.1.2 255.255.255.0.EE.PPAt Bell Labs, our primary IP stack is always to the company's internalfirewall-protected network.  The following creates an externalIP stack to directly access the outside Internet.  Note that theconnection server uses a different set of.I ndbfiles.  This prevents us from confusing inside and outside name/addressbindings..IP.EX% bind -b '#l1' /net.alt% bind -b '#I1' /net.alt% ip/ipconfig -x /net.alt -g 204.178.31.1 ether /net.alt/ether1\\	204.178.31.6 255.255.255.0% ndb/cs -x /net.alt -f /lib/ndb/external% ndb/dns -sx /net.alt -f /lib/ndb/external% aux/listen -d /rc/bin/service.alt /net.alt/tcp.EE.PPGet all addresses via DHCP.Configure the IPv6 link-local address automaticallyand listen for router announcements..IP.EXip/ipconfig -6 ip/ipconfig ra6 recvra 1.EE.SH FILES.B /sys/log/v6routeradv.SH SOURCE.B /sys/src/cmd/ip/ipconfig.br.B /sys/src/cmd/ip/rip.c.br.B /sys/src/cmd/ip/linklocal.c.br.B /rc/bin/ipv6on.SH "SEE ALSO".IR ether (3),.IR ip (3),.IR loopback (3),.IR ndb (6),.IR 6in4 (8),.IR dhcpd (8),.IR ppp (8).br.B /lib/rfc/rfc2373for IPv6's modified EUI-64