README.NetConsole 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. In U-Boot, we implemented the networked console via the standard
  2. "devices" mechanism, which means that you can switch between the
  3. serial and network input/output devices by adjusting the 'stdin' and
  4. 'stdout' environment variables. To switch to the networked console,
  5. set either of these variables to "nc". Input and output can be
  6. switched independently.
  7. CONFIG_NETCONSOLE_BUFFER_SIZE - Override the default buffer size
  8. We use an environment variable 'ncip' to set the IP address and the
  9. port of the destination. The format is <ip_addr>:<port>. If <port> is
  10. omitted, the value of 6666 is used. If the env var doesn't exist, the
  11. broadcast address and port 6666 are used. If it is set to an IP
  12. address of 0 (or 0.0.0.0) then no messages are sent to the network.
  13. The source / listening port can be configured separately by setting
  14. the 'ncinport' environment variable and the destination port can be
  15. configured by setting the 'ncoutport' environment variable.
  16. For example, if your server IP is 192.168.1.1, you could use:
  17. => setenv nc 'setenv stdout nc;setenv stdin nc'
  18. => setenv ncip 192.168.1.1
  19. => saveenv
  20. => run nc
  21. On the host side, please use this script to access the console:
  22. tools/netconsole <ip> [port]
  23. The script uses netcat to talk to the board over UDP. It requires you to
  24. specify the target IP address (or host name, assuming DNS is working). The
  25. script can be interrupted by pressing ^T (CTRL-T).
  26. Be aware that in some distributives (Fedora Core 5 at least)
  27. usage of nc has been changed and -l and -p options are considered
  28. as mutually exclusive. If nc complains about options provided,
  29. you can just remove the -p option from the script.
  30. It turns out that 'netcat' cannot be used to listen to broadcast
  31. packets. We developed our own tool 'ncb' (see tools directory) that
  32. listens to broadcast packets on a given port and dumps them to the
  33. standard output. It will be built when compiling for a board which
  34. has CONFIG_NETCONSOLE defined. If the netconsole script can find it
  35. in PATH or in the same directory, it will be used instead.
  36. For Linux, the network-based console needs special configuration.
  37. Minimally, the host IP address needs to be specified. This can be
  38. done either via the kernel command line, or by passing parameters
  39. while loading the netconsole.o module (when used in a loadable module
  40. configuration). Please refer to Documentation/networking/logging.txt
  41. file for the original Ingo Molnar's documentation on how to pass
  42. parameters to the loadable module.
  43. The format of the kernel command line parameter (for the static
  44. configuration) is as follows:
  45. netconsole=[src-port]@[src-ip]/[<dev>],[tgt-port]@<tgt-ip>/[tgt-macaddr]
  46. where
  47. src-port source for UDP packets
  48. (defaults to 6665)
  49. src-ip source IP to use
  50. (defaults to the interface's address)
  51. dev network interface
  52. (defaults to eth0)
  53. tgt-port port for logging agent
  54. (defaults to 6666)
  55. tgt-ip IP address for logging agent
  56. (this is the required parameter)
  57. tgt-macaddr ethernet MAC address for logging agent
  58. (defaults to broadcast)
  59. Examples:
  60. netconsole=4444@10.0.0.1/eth1,9353@10.0.0.2/12:34:56:78:9a:bc
  61. or
  62. netconsole=@/,@192.168.3.1/
  63. Please note that for the Linux networked console to work, the
  64. ethernet interface has to be up by the time the netconsole driver is
  65. initialized. This means that in case of static kernel configuration,
  66. the respective Ethernet interface has to be brought up using the "IP
  67. Autoconfiguration" kernel feature, which is usually done by defaults
  68. in the ELDK-NFS-based environment.
  69. To browse the Linux network console output, use the 'netcat' tool invoked
  70. as follows:
  71. nc -u -l -p 6666
  72. Note that unlike the U-Boot implementation the Linux netconsole is
  73. unidirectional, i. e. you have console output only in Linux.