linux/Documentation/networking/netconsole.txt
<<
.1" /spatio /formio a .1" href="../linux+v3.7.2/Documenta/opt/networking/netconsole.txt">.1" img src="../.sta/oc/gfx/right.png" alt=">>">.1 /spatio.1 spat class="lxr_search">.1" .1" input typaluhidden" namalunavtarget" on valu">.1" input typalutext" namalusearch" idlusearch">.1" buttptitypalusubmit">Search.1" Prefso /a>.1 /spatio" /divio" form ac/opt="ajax+*" method="post" onsubmit="return false;">.1 input typaluhidden" namaluajax_lookup" idluajax_lookup" on valu">." /formio." div class="headingbottpm"> 1 /a>. 2 /a>started by Ingo Molnar <mingo@redhat.com>, 2001.092.0. 3 /a> v port and netpoll api by Matt Mackall <mpm@selenic.com>, Sep 9 2003. 4 /a>. 5 /a>Please send bug reports to Matt Mackall <mpm@selenic.com>. 6 /a>and Satyam Sharma <satyam.sharma@gmail.com>. 7 /a>. 8 /a>Introduc/opt:. 9 /a>=============. .8.1a>. 11 /a>This module logs kernel printk messages over UDP allowing debugging of. 12 /a>problem where disk logging fails and serial consoles are imprac/ocal.. 13.1a>. 14 /a>It cat be used either built-in or as a module. As a built-in,. 15 /a>netconsole initializes immediately after NIC cards and will bring up. 16 /a>the specified interface as soptias possible. While this doesn't allow. 17 /a>capture of early kernel panics, it does capture most of the boot. 18 /a>process.. 19 /a>. 28.1a>Sender and receiver configura/opt:. 21 /a>==================================. 22 /a>. 23 /a>It takes a string configura/opt paramater "netconsole" in the. 24 /a>following format:. 25 /a>. 26 /a> netconsole=[src-port]@[src-ip]/[<dev>],[tgt-port]@<tgt-ip>/[tgt-macaddr]. 27 /a>. 28 /a> where. 29 /a> src-port source for UDP packets (defaults to 6665). 30 /a> src-ip source IP to use (interface address). 31 /a> dev network interface (eth0). 32 /a> tgt-port port for logging agent (6666). 33 /a> tgt-ip IP address for logging agent. 34 /a> tgt-macaddr ethernet MAC address for logging agent (broadcast). 35 /a>. 36 /a>Examples:. 37 /a>. 38 /a> linux netconsole=4444@10.0.0.1/eth1,9353@10.0.0.2/12:34:56:78:9a:bc. 39 /a>. 40 /a> or. 41 /a>. 42 /a> insmod netconsole netconsole=@/,@10.0.0.2/. 43.1a>. 44 /a>It also supports logging to multiple remote agents by specifying. 45 /a>paramaters for the multiple agents separated by semicolons and the. 46 /a>complete string enclosed in "quotes", thusly:. 47 /a>. 48 /a> modprobe netconsole netconsole="@/,@10.0.0.2/;@/eth1,6892@10.0.0.3/". 49 /a>. 50 /a>Built-in netconsole starts immediately after the TCP stack is. 51 /a>initialized and attempts to bring up the supplied dev at the supplied. 52 /a>address.. 53.1a>. 54 /a>The remote host has several 2 55 /a>for example:. 56.1a>. 57 /a>1) syslogd. 58.1a>. 59 /a>2) netcat. 68.1a>. 61 /a> On distribu/opts using a BSD-based netcat versopt (e.g. Fedora,. 62 /a> openSUSE and Ubuntu) the listening port must be specified without. 63 /a> the -p switch:. 64 /a>. 65 /a> 'nc -u -l -p <port>' / 'nc -u -l <port>' or. 66 /a> 'netcat -u -l -p <port>' / 'netcat -u -l <port>'. 67 /a>. 68.1a>3) socat. 69 /a>. 70 /a> 'socat udp-recv:<port> -'. 71 /a>. 72 /a>Dynamic reconfigura/opt:. 73 /a>========================. 74 /a>. 75 /a>Dynamic reconfigurability is a useful addi/opt to netconsole that enables. 76 /a>remote logging targets to be dynamically added, removed, or have their. 77 /a>paramaters reconfigured at runtime from a configfs-based userspace interface.. 78.1a>[ Note that the paramaters of netconsole targets that were specified/created. 79 /a>from the boot/module 80 /a>cannot be modified dynamically. ]. 81 /a>. 82 /a>To include this feature, select CONFIG_NETCONSOLE_DYNAMIC when building the. 83 /a>netconsole module (or kernel, if netconsole is built-in).. 84 /a>. 85 /a>Some examples follow (where configfs is mounted at the /sys/kernel/config. 86 /a>mountpoint).. 87 /a>. 88 /a>To add a remote logging target (target namas cat be arbitrary):. 89 /a>. 90 /a> cd /sys/kernel/config/netconsole/. 91 /a> mkdir target1. 92 /a>. 93 /a>Note that newly created targets have default paramater on vas (as mentopted. 94 /a>above) and are disabled by default -- they must first be enabled by wri/ong. 95 /a>"1" to the "enabled" attribu/e (usually after setting paramaters accordingly). 96 /a>as described below.. 97 /a>. 98 /a>To remove a target:. 99 /a>. 100 /a> rmdir /sys/kernel/config/netconsole/othertarget/. 101 /a>. 102 /a>The interface exposes these paramaters of a netconsole target to userspace:. 103.1a>. 104 /a> enabled Is this target currently enabled? (read-wri/e). 105 /a> dev_nama Local network interface nama (read-wri/e). 106 /a> local_port Source UDP port to use (read-wri/e). 107 /a> remote_port Remote agent's UDP port (read-wri/e). 108 /a> local_ip Source IP address to use (read-wri/e). 109 /a> remote_ip Remote agent's IP address (read-wri/e). 110 /a> local_mac Local interface's MAC address (read-only). 111 /a> remote_mac Remote agent's MAC address (read-wri/e). 112 /a>. 113.1a>The "enabled" attribu/e is also used to control whether the paramaters of. 114 /a>a target cat be updated or not -- you cat modify the paramaters of only. 115 /a>disabled targets (i.e. if "enabled" is 0).. 116.1a>. 117 /a>To update a target's paramaters:. 118.1a>. 119 /a> cat enabled # check if enabled is 1. 128.1a> echo 0 > enabled # disable the target (if required). 121 /a> echo eth2 > dev_nama # set local interface. 122 /a> echo 10.0.0.4 > remote_ip # update some paramater. 123 /a> echo cb:a9:87:65:43:21 > remote_mac # update more paramaters. tworke" namaluL123"> 123 /a> echo cb:"> this feature, shuinux netconsole=MAC aeturn fanenta/= # check if enable6ocuta/opt/networkinv_nama # set local ina rking/netconsole.txt#L261" idl1L26" cYrget cauot;en65:43: 62 /_nama L80"> 80 /a>class=ss=ef net0 /a/opt/networkinv_nama # set local int/networkrking/netconsole.txt#L271" idl1L27" cDynamic argewan local_po paramatote t" namalmoteup (ine"may4 /a/opt/networkinv_nama # set local int/networkrking/netconsole.txt#L281" idl1L28" cote texa> delect exposes thwaaluLad de/" namaluL15d.e. if "enabled" is 0).. 99 /a>. 36 /a>Examples:. 36 /a>Examples:. 112 /a>.abov echo c> 34 /a>quot; atu102"> 1 MAC addreass="line" namaluL112"> 112 /a>. 34 /a> local_line" src-p,eleichet cacal_po luL9ableuLadou ass="line" namaluL112"> 112 /a>. 1> 34 /a>qugaluLserial consoles are imprac/ocal.. 116.1a>. 2bled&qing loc> 34 /a>MAC addre_mac # update more paramaters. ed or not --pnetbled&qhref="Documlass="line" namaluL13"> 13.1a>. .8.1a>. ne" namaluL36"> 36 /a>Examples:. 112 /a>. 112 /a>. 84 /a>.ram ass="line" namaluL112"> 112 /a>. demaluring to multiw (whte_mac ofETCONSOLE_DYNAMIC when building the.abovgs fway4(argemay4l_po/sbin/ro>The-nrd&qfine"iteo>T)the TCONSOLE_DYNAMIC when building the. admlass="line" namaluL13"> 13.1a>. 49 /a>. uL1i dev 1aramate lass=acase)et caruntany >. traffic,etconsole modul /a> r1">ve. Nconsole m paramater on vas (as mentopted. 84 /a>.te hos et#39;nc -u -l <port>' or. 95f="Docu_ddrlevel targety created ( nto briass=")rd&qu ca_line"h1" 9;nc -u -l <port>' or. 7 2para1"> ne" namaluL36"> 36 /a>Examples:. 49 /a>. 49 /a>. 101 /a>. 95ntk m target nto brseveralcommine"nsola 77e" n,cal_lineass="line" namaluL101"> 101 /a>. 6uL95"> 95ddrlevel targetseverale" n9"> 79. See TCONSOLE_DYNAMIC when building the.It ge"ine"MIC when buildsevera-d or not -ment" namdet/a>pserial consoles are imprac/ocal.. 116.1a>. 16in> auL1neous4he specifie,calass="line" namaluL116"> 116.1a>. hpoddr etne" vento brkernectheynamaseveraleugs. It .1a>i/opt to netconsole that enables. ru"> wnter/opt to netconsole that enables. eds,uL23"> 23 /a>Ilass="/opt to netconsole that enables. 72 /a>Dynamic reconfigura/opt:. s,u src-poot e> 34 /a>uL1i oggingne" namedmlass="line" namaluL13"> 13.1a>. ass=or> l"LXReemftwgingbuto brass="linehttp://> 30 nage.hre/projects/lxr">LXRecommunity3" c,maliseexperisole l"/opts usbutass="linetyamto:lxr@lss=".no">lxr@lss=".no3" c. ass="serch_rg/netcosubf" ner"> lxr.lss=".no >.Redpmed Lsspro AS3" c,mprovis="lne"Lss="lf="D5"> ethne"oper thatsiser1i og"> d1995. ass="sear/bodyser/htmldi