ipconfig 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. .TH IPCONFIG 8
  2. .SH NAME
  3. ipconfig, rip \- Internet configuration and routing
  4. .SH SYNOPSIS
  5. .B ip/ipconfig
  6. .RB [ -NDGPdnpr ]
  7. .RB [ -b
  8. .IR baud ]
  9. .RB [ -c
  10. .IR ctl ]
  11. .RB [ -m
  12. .IR mtu ]
  13. .RB [ -g
  14. .IR gateway ]
  15. .RB [ -h
  16. .IR hostname ]
  17. .RB [ -x
  18. .IR netmtpt ]
  19. .RB [ -o
  20. .IR dhcpoption ]
  21. .I type
  22. .I device
  23. .RI [ verb ]
  24. .RI [ local-addr ]
  25. .RI [ mask ]
  26. .RI [ remote-addr ]
  27. .RI [ file-server-addr ]
  28. .RI [ auth-server-addr ]
  29. .PP
  30. .B ip/rip
  31. .RB [ -bdr ]
  32. .RB [ -x
  33. .IR netmtpt ]
  34. .SH DESCRIPTION
  35. .I Ipconfig
  36. binds a device interface (default
  37. .BR /net/ether0 )
  38. to a mounted IP stack (default
  39. .BR /net )
  40. and configures the interface with a local address, a
  41. mask, and a remote address. The addresses can be specified
  42. in the command line or obtained via DHCP. If DHCP is
  43. requested, it will also obtain the addresses of DNS
  44. servers, NTP servers, gateways, a Plan 9 file server,
  45. and a Plan 9 authentication server. If this is the first
  46. non-loopback
  47. interface on the IP stack, the information will be
  48. written to
  49. .B /net/ndb
  50. in the form of an
  51. .IR ndb (8)
  52. entry.
  53. .PP
  54. .I Type
  55. may be
  56. .BR ether ,
  57. .BR ppp ,
  58. or
  59. .BR gbe .
  60. The
  61. .B gbe
  62. type is equivalent to
  63. .B ether
  64. except that it allows jumbo packets.
  65. For
  66. .B ppp
  67. the device can be any byte stream device.
  68. .PP
  69. The verb (default
  70. .IR add )
  71. determines the action performed. The verbs are:
  72. .TP
  73. .B add
  74. if the device is not bound to the IP stack, bind it.
  75. Add the given local address, mask, and remote address to the interface.
  76. An interface may have multiple addresses.
  77. .TP
  78. .B remove
  79. remove the address from the device interface.
  80. .TP
  81. .B unbind
  82. unbind the device interface and all its addresses from the
  83. IP stack.
  84. .PP
  85. The options are:
  86. .TP
  87. .B D
  88. turn on debugging.
  89. .TP
  90. .B N
  91. look in /lib/ndb for the IP parameters. This only works if the
  92. interface is an ethernet. It uses the ethernet address to find
  93. a matching entry.
  94. .TP
  95. .B G
  96. use only generic DHCP options. Without this option,
  97. .I ipconfig
  98. adds to requests a Vendor Class option with value
  99. .BI plan9_$ cputype
  100. and also requests vendor specific options 128 and 129 which we
  101. interpret as the Plan 9 file server and auth server.
  102. Replies to these options contain a list of IP addresses for possible
  103. file servers and auth servers.
  104. .TP
  105. .B p
  106. write configuration information to
  107. .BR /net/ndb ,
  108. even if other network interfaces are already configured
  109. .TP
  110. .B P
  111. do not write configuration information to
  112. .BR /net/ndb ,
  113. even if this is the first network interface to be configured
  114. .TP
  115. .B b
  116. the baud rate to use on a serial line
  117. when configuring
  118. .BR PPP .
  119. .TP
  120. .B c
  121. write the control string
  122. .I ctl
  123. to the ethernet device control file before starting to configure it.
  124. May be repeated to specify multiple control writes.
  125. .TP
  126. .B d
  127. use DHCP to determine any unspecified configuration parameters.
  128. .TP
  129. .B g
  130. the default gateway.
  131. .TP
  132. .B h
  133. the hostname to add to DHCP requests. Some DHCP
  134. servers, such as the one used by COMCAST, will not respond
  135. unless a correct hostname is in the request.
  136. .TP
  137. .B m
  138. the maximum IP packet size to use on this
  139. interface.
  140. .TP
  141. .B n
  142. determine parameters but don't configure the interface.
  143. .TP
  144. .B r
  145. by default,
  146. .I ipconfig
  147. exits after trying DHCP for 15 seconds with no answer.
  148. This option directs
  149. .I ipconfig
  150. instead to fork a background
  151. process that keeps trying forever.
  152. .TP
  153. .B x
  154. use the IP stack mounted at
  155. .I netmtpt
  156. instead of at
  157. .BR /net .
  158. .TP
  159. .B o
  160. adds
  161. .I dhcpoption
  162. to the list of paramters requested of the DHCP server. The
  163. result will appear in
  164. .B /net/ndb
  165. should this be the first interface. The known options are:
  166. ipmask, timeoff, ipgw, time, name, dns, log, cookie,
  167. lpr, impress, rl, sys, bflen, dumpfile, dom, swap,
  168. rootpath, extpath, ipforward, nonlocal, policyfilter,
  169. maxdatagram, ttl, pathtimeout, pathplateau, mtu,
  170. subnetslocal, baddr, discovermask, supplymask,
  171. discoverrouter, rs, staticroutes, trailerencap,
  172. arptimeout, etherencap, tcpttl, tcpka, tcpkag,
  173. nisdomain, ni, ntp, netbiosns, netbiosdds,
  174. netbiostype, netbiosscope, xfont, xdispmanager,
  175. nisplusdomain, nisplus, homeagent, smtp, pop3, nntp,
  176. www, finger, irc, st, stdar, , ipaddr, lease,
  177. overload, type, serverid, params, message, maxmsg,
  178. renewaltime, rebindingtime, vendorclass, clientid,
  179. tftp, bootfile
  180. .EE
  181. The options
  182. .BR ipmask ,
  183. .BR ipgw ,
  184. .BR dns ,
  185. .BR sys ,
  186. and
  187. .B ntp
  188. are always requested.
  189. .PD
  190. .PP
  191. If DHCP is requested, a process is forked
  192. off to renew the lease before it
  193. runs out. If the lease does run out, this
  194. process will remove any configured addresses
  195. from the interface.
  196. .PP
  197. .I Rip
  198. runs the routing protocol RIP.
  199. It listens for RIP packets on connected networks and
  200. updates the kernel routing tables.
  201. The options are:
  202. .TP
  203. .B b
  204. broadcasts routing information onto the networks.
  205. .TP
  206. .B n
  207. gathers routing information but doesn't write to the
  208. route table. This is useful with
  209. .B \-d
  210. to debug a network.
  211. .TP
  212. .B x
  213. use the IP stack mounted at
  214. .I netmtpt
  215. instead of at
  216. .BR /net .
  217. .TP
  218. .B d
  219. turn on (voluminous) debugging.
  220. .PP
  221. .SH EXAMPLE
  222. Configure Ethernet 0 as the primary IP interface.
  223. Get all addresses via DHCP. Start up a connection server
  224. and DNS resolver for this IP stack.
  225. .IP
  226. .EX
  227. % bind -b '#l0' /net
  228. % bind -a '#I0' /net
  229. % ip/ipconfig
  230. % ndb/cs
  231. % ndb/dns -r
  232. .EE
  233. .PP
  234. Add a second address to the stack.
  235. .IP
  236. .EX
  237. % ip/ipconfig ether /net/ether0 add 12.1.1.2 255.255.255.0
  238. .EE
  239. .PP
  240. At Lucent our primary IP stack is always to the company's internal
  241. firewall-protected network. The following creates an external
  242. IP stack to directly access the outside Internet. Note that the
  243. connection server uses a different set of
  244. .I ndb
  245. files. This prevents us from confusing inside and outside name/address
  246. bindings.
  247. .IP
  248. .EX
  249. % bind -b '#l1' /net.alt
  250. % bind -b '#I1' /net.alt
  251. % ip/ipconfig -x /net.alt -g 204.178.31.1 ether /net.alt/ether1\\
  252. 204.178.31.6 255.255.255.0
  253. % ndb/cs -x /net.alt -f /lib/ndb/external
  254. % ndb/dns -sx /net.alt -f /lib/ndb/external
  255. % aux/listen -d /rc/bin/service.alt /net.alt/tcp
  256. % aux/listen -d /rc/bin/service.alt /net.alt/il
  257. .EE
  258. .SH SOURCE
  259. .B /sys/src/cmd/ip/ipconfig.c
  260. .br
  261. .B /sys/src/cmd/ip/rip.c
  262. .SH "SEE ALSO"
  263. .IR ndb (6)