ipconfig 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. .TH IPCONFIG 8
  2. .SH NAME
  3. ipconfig, rip \- Internet configuration and routing
  4. .SH SYNOPSIS
  5. .B ip/ipconfig
  6. .RB [ -NDGPOdnpr ]
  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. .EX
  167. ipmask, timeoff, ipgw, time, name, dns, log, cookie,
  168. lpr, impress, rl, sys, bflen, dumpfile, dom, swap,
  169. rootpath, extpath, ipforward, nonlocal, policyfilter,
  170. maxdatagram, ttl, pathtimeout, pathplateau, mtu,
  171. subnetslocal, baddr, discovermask, supplymask,
  172. discoverrouter, rs, staticroutes, trailerencap,
  173. arptimeout, etherencap, tcpttl, tcpka, tcpkag,
  174. nisdomain, ni, ntp, netbiosns, netbiosdds,
  175. netbiostype, netbiosscope, xfont, xdispmanager,
  176. nisplusdomain, nisplus, homeagent, smtp, pop3, nntp,
  177. www, finger, irc, st, stdar, ipaddr, lease,
  178. overload, type, serverid, params, message, maxmsg,
  179. renewaltime, rebindingtime, vendorclass, clientid,
  180. tftp, bootfile
  181. .EE
  182. The options
  183. .BR ipmask ,
  184. .BR ipgw ,
  185. .BR dns ,
  186. .BR sys ,
  187. and
  188. .B ntp
  189. are always requested.
  190. .TP
  191. .B O
  192. addresses specified on the command line override those obtained
  193. via DHCP.
  194. A command line address of 0 implies no override.
  195. .PD
  196. .PP
  197. If DHCP is requested, a process is forked
  198. off to renew the lease before it
  199. runs out. If the lease does run out, this
  200. process will remove any configured addresses
  201. from the interface.
  202. .PP
  203. .I Rip
  204. runs the routing protocol RIP.
  205. It listens for RIP packets on connected networks and
  206. updates the kernel routing tables.
  207. The options are:
  208. .TP
  209. .B b
  210. broadcasts routing information onto the networks.
  211. .TP
  212. .B n
  213. gathers routing information but doesn't write to the
  214. route table. This is useful with
  215. .B \-d
  216. to debug a network.
  217. .TP
  218. .B x
  219. use the IP stack mounted at
  220. .I netmtpt
  221. instead of at
  222. .BR /net .
  223. .TP
  224. .B d
  225. turn on (voluminous) debugging.
  226. .PP
  227. .SH EXAMPLE
  228. Configure Ethernet 0 as the primary IP interface.
  229. Get all addresses via DHCP. Start up a connection server
  230. and DNS resolver for this IP stack.
  231. .IP
  232. .EX
  233. % bind -b '#l0' /net
  234. % bind -a '#I0' /net
  235. % ip/ipconfig
  236. % ndb/cs
  237. % ndb/dns -r
  238. .EE
  239. .PP
  240. Add a second address to the stack.
  241. .IP
  242. .EX
  243. % ip/ipconfig ether /net/ether0 add 12.1.1.2 255.255.255.0
  244. .EE
  245. .PP
  246. At Lucent our primary IP stack is always to the company's internal
  247. firewall-protected network. The following creates an external
  248. IP stack to directly access the outside Internet. Note that the
  249. connection server uses a different set of
  250. .I ndb
  251. files. This prevents us from confusing inside and outside name/address
  252. bindings.
  253. .IP
  254. .EX
  255. % bind -b '#l1' /net.alt
  256. % bind -b '#I1' /net.alt
  257. % ip/ipconfig -x /net.alt -g 204.178.31.1 ether /net.alt/ether1\\
  258. 204.178.31.6 255.255.255.0
  259. % ndb/cs -x /net.alt -f /lib/ndb/external
  260. % ndb/dns -sx /net.alt -f /lib/ndb/external
  261. % aux/listen -d /rc/bin/service.alt /net.alt/tcp
  262. % aux/listen -d /rc/bin/service.alt /net.alt/il
  263. .EE
  264. .SH SOURCE
  265. .B /sys/src/cmd/ip/ipconfig.c
  266. .br
  267. .B /sys/src/cmd/ip/rip.c
  268. .SH "SEE ALSO"
  269. .IR ndb (6)