ipconfig 6.1 KB

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