ipconfig 4.9 KB

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