ipconfig 4.3 KB

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