Track2Agenda: 4.4.1.rancid-exercise.htm

File 4.4.1.rancid-exercise.htm, 48.2 KB (added by jon, 3 years ago)
Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5  <meta http-equiv="Content-Style-Type" content="text/css" />
6  <meta name="generator" content="pandoc" />
7  <title>Network Management &amp; Monitoring</title>
8  <style type="text/css">code{white-space: pre;}</style>
9  <link href="data:text/css,%2F%2A%0A%20%20%20%20Buttondown%0A%20%20%20%20A%20Markdown%2FMultiMarkdown%2FPandoc%20HTML%20output%20CSS%20stylesheet%0A%20%20%20%20Author%3A%20Ryan%20Gray%0A%20%20%20%20Date%3A%2015%20Feb%202011%0A%20%20%20%20Revised%3A%2021%20Feb%202012%0A%20%20%20%0A%20%20%20%20General%20style%20is%20clean%2C%20with%20minimal%20re%2Ddefinition%20of%20the%20defaults%20or%20%0A%20%20%20%20overrides%20of%20user%20font%20settings%2E%20The%20body%20text%20and%20header%20styles%20are%20%0A%20%20%20%20left%20alone%20except%20title%2C%20author%20and%20date%20classes%20are%20centered%2E%20A%20Pandoc%20TOC%20%0A%20%20%20%20is%20not%20printed%2C%20URLs%20are%20printed%20after%20hyperlinks%20in%20parentheses%2E%20%0A%20%20%20%20Block%20quotes%20are%20italicized%2E%20Tables%20are%20lightly%20styled%20with%20lines%20above%20%0A%20%20%20%20and%20below%20the%20table%20and%20below%20the%20header%20with%20a%20boldface%20header%2E%20Code%20%0A%20%20%20%20blocks%20are%20line%20wrapped%2E%20%0A%20%0A%20%20%20%20All%20elements%20that%20Pandoc%20and%20MultiMarkdown%20use%20should%20be%20listed%20here%2C%20even%20%0A%20%20%20%20if%20the%20style%20is%20empty%20so%20you%20can%20easily%20add%20styling%20to%20anything%2E%0A%20%20%20%20%0A%20%20%20%20There%20are%20some%20elements%20in%20here%20for%20HTML5%20output%20of%20Pandoc%2C%20but%20I%20have%20not%20%0A%20%20%20%20gotten%20around%20to%20testing%20that%20yet%2E%0A%2A%2F%0A%20%0A%2F%2A%20NOTES%3A%0A%20%0A%20%20%20%20Stuff%20tried%20and%20failed%3A%0A%20%20%20%20%0A%20%20%20%20It%20seems%20that%20specifying%20font%2Dfamily%3Aserif%20in%20Safari%20will%20always%20use%20%0A%20%20%20%20Times%20New%20Roman%20rather%20than%20the%20user%27s%20preferences%20setting%2E%0A%20%20%20%20%0A%20%20%20%20Making%20the%20font%20size%20different%20or%20a%20fixed%20value%20for%20print%20in%20case%20the%20screen%20%0A%20%20%20%20font%20size%20is%20making%20the%20print%20font%20too%20big%3A%20Making%20font%2Dsize%20different%20for%20%0A%20%20%20%20print%20than%20for%20screen%20causes%20horizontal%20lines%20to%20disappear%20in%20math%20when%20using%20%0A%20%20%20%20MathJax%20under%20Safari%2E%0A%2A%2F%0A%20%0A%2F%2A%20%2D%2D%2D%2D%20Front%20Matter%20%2D%2D%2D%2D%20%2A%2F%0A%20%0A%2F%2A%20Pandoc%20header%20DIV%2E%20Contains%20%2Etitle%2C%20%2Eauthor%20and%20%2Edate%2E%20Comes%20before%20div%23TOC%2E%20%0A%20%20%20Only%20appears%20if%20one%20of%20those%20three%20are%20in%20the%20document%2E%0A%2A%2F%0A%20%0Adiv%23header%2C%20header%0A%20%20%20%20%7B%0A%20%20%20%20%2F%2A%20Put%20border%20on%20bottom%2E%20Separates%20it%20from%20TOC%20or%20body%20that%20comes%20after%20it%2E%20%2A%2F%0A%20%20%20%20border%2Dbottom%3A%201px%20solid%20%23aaa%3B%0A%20%20%20%20margin%2Dbottom%3A%200%2E5em%3B%0A%20%20%20%20%7D%0A%20%0A%2Etitle%20%2F%2A%20Pandoc%20title%20header%20%28h1%2Etitle%29%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20text%2Dalign%3A%20center%3B%0A%20%20%20%20%7D%0A%20%0A%2Eauthor%2C%20%2Edate%20%2F%2A%20Pandoc%20author%28s%29%20and%20date%20headers%20%28h2%2Eauthor%20and%20h3%2Edate%29%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20text%2Dalign%3A%20center%3B%0A%20%20%20%20%7D%0A%20%0A%2F%2A%20Pandoc%20table%20of%20contents%20DIV%20when%20using%20the%20%2D%2Dtoc%20option%2E%0A%20%20%20NOTE%3A%20this%20doesn%27t%20support%20Pandoc%27s%20%2D%2Did%2Dprefix%20option%20for%20%23TOC%20and%20%23header%2E%20%0A%20%20%20Probably%20would%20need%20to%20use%20div%5Bid%24%3D%27TOC%27%5D%20and%20div%5Bid%24%3D%27header%27%5D%20as%20selectors%2E%0A%2A%2F%0A%20%0Adiv%23TOC%2C%20nav%23TOC%0A%20%20%20%20%7B%0A%20%20%20%20%2F%2A%20Put%20border%20on%20bottom%20to%20separate%20it%20from%20body%2E%20%2A%2F%0A%20%20%20%20border%2Dbottom%3A%201px%20solid%20%23aaa%3B%0A%20%20%20%20margin%2Dbottom%3A%200%2E5em%3B%0A%20%20%20%20%7D%0A%20%0A%40media%20print%0A%20%20%20%20%7B%0A%20%20%20%20div%23TOC%2C%20nav%23TOC%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%2F%2A%20Don%27t%20display%20TOC%20in%20print%20%2A%2F%0A%20%20%20%20%20%20%20%20display%3A%20none%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%0A%2F%2A%20%2D%2D%2D%2D%20Headers%20and%20sections%20%2D%2D%2D%2D%20%2A%2F%0A%20%0Ah1%2C%20h2%2C%20h3%2C%20h4%2C%20h5%2C%20h6%0A%7B%0A%20%20%20%20font%2Dfamily%3A%20%22Helvetica%20Neue%22%2C%20Helvetica%2C%20%22Liberation%20Sans%22%2C%20Calibri%2C%20Arial%2C%20sans%2Dserif%3B%20%2F%2A%20Sans%2Dserif%20headers%20%2A%2F%0A%20%0A%20%20%20%20%2F%2A%20font%2Dfamily%3A%20%22Liberation%20Serif%22%2C%20%22Georgia%22%2C%20%22Times%20New%20Roman%22%2C%20serif%3B%20%2F%2A%20Serif%20headers%20%2A%2F%0A%20%0A%20%20%20%20page%2Dbreak%2Dafter%3A%20avoid%3B%20%2F%2A%20Firefox%2C%20Chrome%2C%20and%20Safari%20do%20not%20support%20the%20property%20value%20%22avoid%22%20%2A%2F%0A%7D%0A%20%0A%2F%2A%20Pandoc%20with%20%2D%2Dsection%2Ddivs%20option%20%2A%2F%0A%20%0Adiv%20div%2C%20section%20section%20%2F%2A%20Nested%20sections%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20margin%2Dleft%3A%202em%3B%20%2F%2A%20This%20will%20increasingly%20indent%20nested%20header%20sections%20%2A%2F%0A%20%20%20%20%7D%0A%20%0Ap%20%7B%7D%0A%20%0Ablockquote%0A%20%20%20%20%7B%20%0A%20%20%20%20font%2Dstyle%3A%20italic%3B%0A%20%20%20%20%7D%0A%20%0Ali%20%2F%2A%20All%20list%20items%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%20%0Ali%20%3E%20p%20%2F%2A%20Loosely%20spaced%20list%20item%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20margin%2Dtop%3A%201em%3B%20%2F%2A%20IE%3A%20lack%20of%20space%20above%20a%20%3Cli%3E%20when%20the%20item%20is%20inside%20a%20%3Cp%3E%20%2A%2F%0A%20%20%20%20%7D%0A%20%0Aul%20%2F%2A%20Whole%20unordered%20list%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%20%0Aul%20li%20%2F%2A%20Unordered%20list%20item%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%20%0Aol%20%2F%2A%20Whole%20ordered%20list%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%20%0Aol%20li%20%2F%2A%20Ordered%20list%20item%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%20%0Ahr%20%7B%7D%0A%20%0A%2F%2A%20%2D%2D%2D%2D%20Some%20span%20elements%20%2D%2D%2D%20%2A%2F%0A%20%0Asub%20%2F%2A%20Subscripts%2E%20Pandoc%3A%20H%7E2%7EO%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%20%0Asup%20%2F%2A%20Superscripts%2E%20Pandoc%3A%20The%202%5End%5E%20try%2E%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%20%20%20%20%0Aem%20%2F%2A%20Emphasis%2E%20Markdown%3A%20%2Aemphasis%2A%20or%20%5Femphasis%5F%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%20%20%20%20%0Aem%20%3E%20em%20%2F%2A%20Emphasis%20within%20emphasis%3A%20%2AThis%20is%20all%20%2Aemphasized%2A%20except%20that%2A%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20font%2Dstyle%3A%20normal%3B%0A%20%20%20%20%7D%0A%20%0Astrong%20%2F%2A%20Markdown%20%2A%2Astrong%2A%2A%20or%20%5F%5Fstrong%5F%5F%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%20%0A%2F%2A%20%2D%2D%2D%2D%20Links%20%28anchors%29%20%2D%2D%2D%2D%20%2A%2F%0A%20%0Aa%20%2F%2A%20All%20links%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%2F%2A%20Keep%20links%20clean%2E%20On%20screen%2C%20they%20are%20colored%3B%20in%20print%2C%20they%20do%20nothing%20anyway%2E%20%2A%2F%0A%20%20%20%20text%2Ddecoration%3A%20none%3B%0A%20%20%20%20%7D%0A%20%0A%40media%20screen%0A%20%20%20%20%7B%0A%20%20%20%20a%3Ahover%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%2F%2A%20On%20hover%2C%20we%20indicate%20a%20bit%20more%20that%20it%20is%20a%20link%2E%20%2A%2F%0A%20%20%20%20%20%20%20%20text%2Ddecoration%3A%20underline%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%0A%40media%20print%0A%20%20%20%20%7B%0A%20%20%20%20a%20%20%20%7B%0A%20%20%20%20%20%20%20%20%2F%2A%20In%20print%2C%20a%20colored%20link%20is%20useless%2C%20so%20un%2Dstyle%20it%2E%20%2A%2F%0A%20%20%20%20%20%20%20%20color%3A%20black%3B%0A%20%20%20%20%20%20%20%20background%3A%20transparent%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20a%5Bhref%5E%3D%22http%3A%2F%2F%22%5D%3Aafter%2C%20a%5Bhref%5E%3D%22https%3A%2F%2F%22%5D%3Aafter%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%2F%2A%20However%2C%20links%20that%20go%20somewhere%20else%2C%20might%20be%20useful%20to%20the%20reader%2C%0A%20%20%20%20%20%20%20%20%20%20%20so%20for%20http%20and%20https%20links%2C%20print%20the%20URL%20after%20what%20was%20the%20link%20%0A%20%20%20%20%20%20%20%20%20%20%20text%20in%20parens%0A%20%20%20%20%20%20%20%20%2A%2F%0A%20%20%20%20%20%20%20%20content%3A%20%22%20%28%22%20attr%28href%29%20%22%29%20%22%3B%0A%20%20%20%20%20%20%20%20font%2Dsize%3A%2090%25%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%0A%2F%2A%20%2D%2D%2D%2D%20Images%20%2D%2D%2D%2D%20%2A%2F%0A%20%0Aimg%0A%20%20%20%20%7B%0A%20%20%20%20%2F%2A%20Let%20it%20be%20inline%20left%2Fright%20where%20it%20wants%20to%20be%2C%20but%20verticality%20make%20%0A%20%20%20%20%20%20%20it%20in%20the%20middle%20to%20look%20nicer%2C%20but%20opinions%20differ%2C%20and%20if%20in%20a%20multi%2Dline%20%0A%20%20%20%20%20%20%20paragraph%2C%20it%20might%20not%20be%20so%20great%2E%20%0A%20%20%20%20%2A%2F%0A%20%20%20%20vertical%2Dalign%3A%20middle%3B%0A%20%20%20%20%7D%0A%20%0Adiv%2Efigure%20%2F%2A%20Pandoc%20figure%2Dstyle%20image%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%2F%2A%20Center%20the%20image%20and%20caption%20%2A%2F%0A%20%20%20%20margin%2Dleft%3A%20auto%3B%0A%20%20%20%20margin%2Dright%3A%20auto%3B%0A%20%20%20%20text%2Dalign%3A%20center%3B%0A%20%20%20%20font%2Dstyle%3A%20italic%3B%0A%20%20%20%20%7D%0A%20%0Ap%2Ecaption%20%2F%2A%20Pandoc%20figure%2Dstyle%20caption%20within%20div%2Efigure%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%2F%2A%20Inherits%20div%2Efigure%20props%20by%20default%20%2A%2F%0A%20%20%20%20%7D%0A%20%0A%2F%2A%20%2D%2D%2D%2D%20Code%20blocks%20and%20spans%20%2D%2D%2D%2D%20%2A%2F%0A%20%0Apre%2C%20code%20%0A%20%20%20%20%7B%0A%20%20%20%20background%2Dcolor%3A%20%23fdf7ee%3B%0A%20%20%20%20%2F%2A%20BEGIN%20word%20wrap%20%2A%2F%0A%20%20%20%20%2F%2A%20Need%20all%20the%20following%20to%20word%20wrap%20instead%20of%20scroll%20box%20%2A%2F%0A%20%20%20%20%2F%2A%20This%20will%20override%20the%20overflow%3Aauto%20if%20present%20%2A%2F%0A%20%20%20%20white%2Dspace%3A%20pre%2Dwrap%3B%20%2F%2A%20css%2D3%20%2A%2F%0A%20%20%20%20white%2Dspace%3A%20%2Dmoz%2Dpre%2Dwrap%20%21important%3B%20%2F%2A%20Mozilla%2C%20since%201999%20%2A%2F%0A%20%20%20%20white%2Dspace%3A%20%2Dpre%2Dwrap%3B%20%2F%2A%20Opera%204%2D6%20%2A%2F%0A%20%20%20%20white%2Dspace%3A%20%2Do%2Dpre%2Dwrap%3B%20%2F%2A%20Opera%207%20%2A%2F%0A%20%20%20%20word%2Dwrap%3A%20break%2Dword%3B%20%2F%2A%20Internet%20Explorer%205%2E5%2B%20%2A%2F%0A%20%20%20%20%2F%2A%20END%20word%20wrap%20%2A%2F%0A%20%20%20%20%7D%0A%20%0Apre%20%2F%2A%20Code%20blocks%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%2F%2A%20Distinguish%20pre%20blocks%20from%20other%20text%20by%20more%20than%20the%20font%20with%20a%20background%20tint%2E%20%2A%2F%0A%20%20%20%20padding%3A%200%2E5em%3B%20%2F%2A%20Since%20we%20have%20a%20background%20color%20%2A%2F%0A%20%20%20%20border%2Dradius%3A%205px%3B%20%2F%2A%20Softens%20it%20%2A%2F%0A%20%20%20%20%2F%2A%20Give%20it%20a%20some%20definition%20%2A%2F%0A%20%20%20%20border%3A%201px%20solid%20%23aaa%3B%0A%20%20%20%20%2F%2A%20Set%20it%20off%20left%20and%20right%2C%20seems%20to%20look%20a%20bit%20nicer%20when%20we%20have%20a%20background%20%2A%2F%0A%20%20%20%20margin%2Dleft%3A%20%200%2E5em%3B%0A%20%20%20%20margin%2Dright%3A%200%2E5em%3B%0A%20%20%20%20%7D%0A%20%0A%40media%20screen%0A%20%20%20%20%7B%0A%20%20%20%20pre%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%2F%2A%20On%20screen%2C%20use%20an%20auto%20scroll%20box%20for%20long%20lines%2C%20unless%20word%2Dwrap%20is%20enabled%20%2A%2F%0A%20%20%20%20%20%20%20%20white%2Dspace%3A%20pre%3B%0A%20%20%20%20%20%20%20%20overflow%3A%20auto%3B%0A%20%20%20%20%20%20%20%20%2F%2A%20Dotted%20looks%20better%20on%20screen%20and%20solid%20seems%20to%20print%20better%2E%20%2A%2F%0A%20%20%20%20%20%20%20%20border%3A%201px%20dotted%20%23777%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%0Acode%20%2F%2A%20All%20inline%20code%20spans%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%20%0Ap%20%3E%20code%2C%20li%20%3E%20code%20%2F%2A%20Code%20spans%20in%20paragraphs%20and%20tight%20lists%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%2F%2A%20Pad%20a%20little%20from%20adjacent%20text%20%2A%2F%0A%20%20%20%20padding%2Dleft%3A%20%202px%3B%0A%20%20%20%20padding%2Dright%3A%202px%3B%0A%20%20%20%20%7D%0A%20%20%20%20%0Ali%20%3E%20p%20code%20%2F%2A%20Code%20span%20in%20a%20loose%20list%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%2F%2A%20We%20have%20room%20for%20some%20more%20background%20color%20above%20and%20below%20%2A%2F%0A%20%20%20%20padding%3A%202px%3B%0A%20%20%20%20%7D%0A%20%0A%2F%2A%20%2D%2D%2D%2D%20Math%20%2D%2D%2D%2D%20%2A%2F%0A%20%0Aspan%2Emath%20%2F%2A%20Pandoc%20inline%20math%20default%20and%20%2D%2Djsmath%20inline%20math%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%2F%2A%20Tried%20font%2Dstyle%3Aitalic%20here%2C%20and%20it%20messed%20up%20MathJax%20rendering%20in%20some%20browsers%2E%20Maybe%20don%27t%20mess%20with%20at%20all%2E%20%2A%2F%0A%20%20%20%20%7D%0A%20%20%20%20%0Adiv%2Emath%20%2F%2A%20Pandoc%20%2D%2Djsmath%20display%20math%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%20%20%20%20%0Aspan%2ELaTeX%20%2F%2A%20Pandoc%20%2D%2Dlatexmathml%20math%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%20%0A%20%0Aeq%20%2F%2A%20Pandoc%20%2D%2Dgladtex%20math%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%20%0A%20%0A%2F%2A%20%2D%2D%2D%2D%20Tables%20%2D%2D%2D%2D%20%2A%2F%0A%20%0A%2F%2A%20%20A%20clean%20textbook%2Dlike%20style%20with%20horizontal%20lines%20above%20and%20below%20and%20under%20%0A%20%20%20%20the%20header%2E%20Rows%20highlight%20on%20hover%20to%20help%20scanning%20the%20table%20on%20screen%2E%0A%2A%2F%0A%20%0Atable%0A%20%20%20%20%7B%0A%20%20%20%20border%2Dcollapse%3A%20collapse%3B%0A%20%20%20%20border%2Dspacing%3A%200%3B%20%2F%2A%20IE%206%20%2A%2F%0A%20%0A%20%20%20%20border%2Dbottom%3A%202pt%20solid%20%23000%3B%0A%20%20%20%20border%2Dtop%3A%202pt%20solid%20%23000%3B%20%2F%2A%20The%20caption%20on%20top%20will%20not%20have%20a%20bottom%2Dborder%20%2A%2F%0A%20%0A%20%20%20%20%2F%2A%20Center%20%2A%2F%0A%20%20%20%20margin%2Dleft%3A%20auto%3B%0A%20%20%20%20margin%2Dright%3A%20auto%3B%0A%20%20%20%20%7D%0A%20%20%20%20%0Athead%20%2F%2A%20Entire%20table%20header%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20border%2Dbottom%3A%201pt%20solid%20%23000%3B%0A%20%20%20%20background%2Dcolor%3A%20%23eee%3B%20%2F%2A%20Does%20this%20BG%20print%20well%3F%20%2A%2F%0A%20%20%20%20%7D%0A%20%0Atr%2Eheader%20%2F%2A%20Each%20header%20row%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%20%0A%20%0Atbody%20%2F%2A%20Entire%20table%20%20body%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%20%0A%2F%2A%20Table%20body%20rows%20%2A%2F%0A%20%0Atr%20%20%7B%0A%20%20%20%20%7D%0Atr%2Eodd%3Ahover%2C%20tr%2Eeven%3Ahover%20%2F%2A%20Use%20%2Eodd%20and%20%2Eeven%20classes%20to%20avoid%20styling%20rows%20in%20other%20tables%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20background%2Dcolor%3A%20%23eee%3B%0A%20%20%20%20%7D%0A%20%20%20%20%0A%2F%2A%20Odd%20and%20even%20rows%20%2A%2F%0Atr%2Eodd%20%7B%7D%0Atr%2Eeven%20%7B%7D%0A%20%0Atd%2C%20th%20%2F%2A%20Table%20cells%20and%20table%20header%20cells%20%2A%2F%0A%20%20%20%20%7B%20%0A%20%20%20%20vertical%2Dalign%3A%20top%3B%20%2F%2A%20Word%20%2A%2F%0A%20%20%20%20vertical%2Dalign%3A%20baseline%3B%20%2F%2A%20Others%20%2A%2F%0A%20%20%20%20padding%2Dleft%3A%20%20%200%2E5em%3B%0A%20%20%20%20padding%2Dright%3A%20%200%2E5em%3B%0A%20%20%20%20padding%2Dtop%3A%20%20%20%200%2E2em%3B%0A%20%20%20%20padding%2Dbottom%3A%200%2E2em%3B%0A%20%20%20%20%7D%0A%20%20%20%20%0A%2F%2A%20Removes%20padding%20on%20left%20and%20right%20of%20table%20for%20a%20tight%20look%2E%20Good%20if%20thead%20has%20no%20background%20color%2A%2F%0A%2F%2A%0Atr%20td%3Alast%2Dchild%2C%20tr%20th%3Alast%2Dchild%0A%20%20%20%20%7B%0A%20%20%20%20padding%2Dright%3A%200%3B%0A%20%20%20%20%7D%0Atr%20td%3Afirst%2Dchild%2C%20tr%20th%3Afirst%2Dchild%20%0A%20%20%20%20%7B%0A%20%20%20%20padding%2Dleft%3A%200%3B%0A%20%20%20%20%7D%0A%2A%2F%0A%20%0Ath%20%2F%2A%20Table%20header%20cells%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20font%2Dweight%3A%20bold%3B%20%0A%20%20%20%20%7D%0A%20%0Atfoot%20%2F%2A%20Table%20footer%20%28what%20appears%20here%20if%20caption%20is%20on%20top%3F%29%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%20%0Acaption%20%2F%2A%20This%20is%20for%20a%20table%20caption%20tag%2C%20not%20the%20p%2Ecaption%20Pandoc%20uses%20in%20a%20div%2Efigure%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20caption%2Dside%3A%20top%3B%0A%20%20%20%20border%3A%20none%3B%0A%20%20%20%20font%2Dsize%3A%200%2E9em%3B%0A%20%20%20%20font%2Dstyle%3A%20italic%3B%0A%20%20%20%20text%2Dalign%3A%20center%3B%0A%20%20%20%20margin%2Dbottom%3A%200%2E3em%3B%20%2F%2A%20Good%20for%20when%20on%20top%20%2A%2F%0A%20%20%20%20padding%2Dbottom%3A%200%2E2em%3B%0A%20%20%20%20%7D%0A%20%0A%2F%2A%20%2D%2D%2D%2D%20Definition%20lists%20%2D%2D%2D%2D%20%2A%2F%0A%20%0Adl%20%2F%2A%20The%20whole%20list%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20border%2Dtop%3A%202pt%20solid%20black%3B%0A%20%20%20%20padding%2Dtop%3A%200%2E5em%3B%0A%20%20%20%20border%2Dbottom%3A%202pt%20solid%20black%3B%0A%20%20%20%20%7D%0A%20%0Adt%20%2F%2A%20Definition%20term%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20font%2Dweight%3A%20bold%3B%0A%20%20%20%20%7D%0A%20%0Add%2Bdt%20%2F%2A%202nd%20or%20greater%20term%20in%20the%20list%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20border%2Dtop%3A%201pt%20solid%20black%3B%0A%20%20%20%20padding%2Dtop%3A%200%2E5em%3B%0A%20%20%20%20%7D%0A%20%20%20%20%0Add%20%2F%2A%20A%20definition%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20margin%2Dbottom%3A%200%2E5em%3B%0A%20%20%20%20%7D%0A%20%0Add%2Bdd%20%2F%2A%202nd%20or%20greater%20definition%20of%20a%20term%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20border%2Dtop%3A%201px%20solid%20black%3B%20%2F%2A%20To%20separate%20multiple%20definitions%20%2A%2F%0A%20%20%20%20%7D%0A%20%20%20%20%0A%2F%2A%20%2D%2D%2D%2D%20Footnotes%20%2D%2D%2D%2D%20%2A%2F%0A%20%0Aa%2Efootnote%2C%20a%2EfootnoteRef%20%7B%20%2F%2A%20Pandoc%2C%20MultiMarkdown%20footnote%20links%20%2A%2F%0A%20%20%20%20font%2Dsize%3A%20small%3B%20%0A%20%20%20%20vertical%2Dalign%3A%20text%2Dtop%3B%0A%7D%0A%20%0Aa%5Bhref%5E%3D%22%23fnref%22%5D%2C%20a%2Ereversefootnote%20%2F%2A%20Pandoc%2C%20MultiMarkdown%2C%20%3F%3F%20footnote%20back%20links%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%20%0A%40media%20print%0A%20%20%20%20%7B%0A%20%20%20%20a%5Bhref%5E%3D%22%23fnref%22%5D%2C%20a%2Ereversefootnote%20%2F%2A%20Pandoc%2C%20MultiMarkdown%20%2A%2F%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%2F%2A%20Don%27t%20display%20these%20at%20all%20in%20print%20since%20the%20arrow%20is%20only%20something%20to%20click%20on%20%2A%2F%0A%20%20%20%20%20%20%20%20display%3A%20none%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%20%20%0Adiv%2Efootnotes%20%2F%2A%20Pandoc%20footnotes%20div%20at%20end%20of%20the%20document%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%20%20%20%20%0Adiv%2Efootnotes%20li%5Bid%5E%3D%22fn%22%5D%20%2F%2A%20A%20footnote%20item%20within%20that%20div%20%2A%2F%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%20%0A%2F%2A%20You%20can%20class%20stuff%20as%20%22noprint%22%20to%20not%20print%2E%20%0A%20%20%20Useful%20since%20you%20can%27t%20set%20this%20media%20conditional%20inside%20an%20HTML%20element%27s%20%0A%20%20%20style%20attribute%20%28I%20think%29%2C%20and%20you%20don%27t%20want%20to%20make%20another%20stylesheet%20that%20%0A%20%20%20imports%20this%20one%20and%20adds%20a%20class%20just%20to%20do%20this%2E%0A%2A%2F%0A%20%0A%40media%20print%0A%20%20%20%20%7B%0A%20%20%20%20%2Enoprint%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20display%3Anone%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A" rel="stylesheet" type="text/css" />
10</head>
11<body>
12<div id="header">
13<h1 class="title">Network Management &amp; Monitoring</h1>
14<h3 class="date">Using RANCID</h3>
15</div>
16<div id="TOC">
17<ul>
18<li><a href="#introduction"><span class="toc-section-number">1</span> Introduction</a><ul>
19<li><a href="#goals"><span class="toc-section-number">1.1</span> Goals</a></li>
20<li><a href="#notes"><span class="toc-section-number">1.2</span> Notes</a></li>
21</ul></li>
22<li><a href="#exercises"><span class="toc-section-number">2</span> Exercises</a></li>
23<li><a href="#connect-to-your-pc-using-ssh"><span class="toc-section-number">3</span> Connect to your PC using ssh</a></li>
24<li><a href="#become-root-and-install-the-subversion-version-control-system"><span class="toc-section-number">4</span> Become root, and install the Subversion Version Control System:</a></li>
25<li><a href="#install-rancid-itself"><span class="toc-section-number">5</span> Install Rancid itself</a></li>
26<li><a href="#add-an-alias-for-the-rancid-user-in-etcaliases-file"><span class="toc-section-number">6</span> Add an alias for the rancid user in /etc/aliases file</a></li>
27<li><a href="#edit-etcrancidrancid.conf"><span class="toc-section-number">7</span> Edit /etc/rancid/rancid.conf</a></li>
28<li><a href="#change-to-the-rancid-user"><span class="toc-section-number">8</span> Change to the rancid user</a></li>
29<li><a href="#critical-critical-critical"><span class="toc-section-number">9</span> CRITICAL! CRITICAL! CRITICAL!</a></li>
30<li><a href="#critical-critical-critical-1"><span class="toc-section-number">10</span> CRITICAL! CRITICAL! CRITICAL!</a></li>
31<li><a href="#critical-critical-critical-2"><span class="toc-section-number">11</span> CRITICAL! CRITICAL! CRITICAL!</a></li>
32<li><a href="#if-you-are-not-user-rancid-now-do-not-continue"><span class="toc-section-number">12</span> IF YOU ARE NOT USER RANCID NOW, do NOT continue</a></li>
33<li><a href="#create-varlibrancid.cloginrc"><span class="toc-section-number">13</span> Create /var/lib/rancid/.cloginrc</a></li>
34<li><a href="#test-login-to-the-router-of-your-group"><span class="toc-section-number">14</span> 8. Test login to the router of your group</a></li>
35<li><a href="#initialize-the-svn-repository-for-rancid"><span class="toc-section-number">15</span> Initialize the SVN repository for rancid:</a></li>
36<li><a href="#do-this-only-if-you-have-problems"><span class="toc-section-number">16</span> Do this ONLY if you have problems</a></li>
37<li><a href="#create-the-router.db-file"><span class="toc-section-number">17</span> Create the router.db file</a></li>
38<li><a href="#lets-run-rancid"><span class="toc-section-number">18</span> Let's run rancid!</a></li>
39<li><a href="#check-the-rancid-log-files"><span class="toc-section-number">19</span> Check the rancid log files:</a></li>
40<li><a href="#look-at-the-configs"><span class="toc-section-number">20</span> Look at the configs</a></li>
41<li><a href="#lets-change-an-interface-description-on-the-router"><span class="toc-section-number">21</span> Let's change an interface Description on the router</a></li>
42<li><a href="#lets-run-rancid-again"><span class="toc-section-number">22</span> Let's run rancid again:</a></li>
43<li><a href="#lets-see-the-differences"><span class="toc-section-number">23</span> Let's see the differences</a></li>
44<li><a href="#check-your-mail"><span class="toc-section-number">24</span> Check your mail</a></li>
45<li><a href="#lets-make-rancid-run-automatically-every-30-minutes-from-using-cron"><span class="toc-section-number">25</span> Let's make rancid run automatically every 30 minutes from using cron</a></li>
46<li><a href="#now-add-all-the-other-routers"><span class="toc-section-number">26</span> Now add all the other routers</a></li>
47<li><a href="#run-rancid-again"><span class="toc-section-number">27</span> Run rancid again:</a></li>
48<li><a href="#check-out-the-logs"><span class="toc-section-number">28</span> Check out the logs:</a></li>
49<li><a href="#look-at-the-configs-1"><span class="toc-section-number">29</span> Look at the configs</a></li>
50<li><a href="#run-rancid-again-just-in-case-someone-changed-some-configuration-on-the-router"><span class="toc-section-number">30</span> Run RANCID again just in case someone changed some configuration on the router</a></li>
51<li><a href="#play-with-clogin"><span class="toc-section-number">31</span> Play with clogin:</a></li>
52<li><a href="#add-the-rancid-svn-subversion-repository-in-to-websvn"><span class="toc-section-number">32</span> Add the RANCID SVN (Subversion) repository in to WebSVN</a></li>
53<li><a href="#fix-permissions.-the-web-server-must-be-able-to-read-the-svn-subversion-folder"><span class="toc-section-number">33</span> Fix permissions. The web server must be able to read the SVN (Subversion) folder</a></li>
54<li><a href="#browse-the-rancid-files-from-your-web-browser"><span class="toc-section-number">34</span> Browse the rancid files from your Web browser!</a></li>
55<li><a href="#review-revisions"><span class="toc-section-number">35</span> Review revisions</a></li>
56<li><a href="#optional-fetching-configs-with-a-non-privileged-rancid-user"><span class="toc-section-number">36</span> Optional: Fetching configs with a non-privileged <code>rancid</code> user</a></li>
57<li><a href="#on-the-use-of-hostnames-in-rancid-vs.-ip-addresses"><span class="toc-section-number">37</span> On the use of hostnames in RANCID vs. IP Addresses</a></li>
58</ul>
59</div>
60<h1 id="introduction"><span class="header-section-number">1</span> Introduction</h1>
61<h2 id="goals"><span class="header-section-number">1.1</span> Goals</h2>
62<ul>
63<li>Gain experience with RANCID</li>
64</ul>
65<h2 id="notes"><span class="header-section-number">1.2</span> Notes</h2>
66<ul>
67<li>Commands preceded with &quot;$&quot; imply that you should execute the command as a general user - not as root.</li>
68<li>Commands preceded with &quot;#&quot; imply that you should be working as root.</li>
69<li>Commands with more specific command lines (e.g. &quot;rtrX&gt;&quot; or &quot;mysql&gt;&quot;) imply that you are executing commands on remote equipment, or within another program.</li>
70</ul>
71<h1 id="exercises"><span class="header-section-number">2</span> Exercises</h1>
72<h1 id="connect-to-your-pc-using-ssh"><span class="header-section-number">3</span> Connect to your PC using ssh</h1>
73<h1 id="become-root-and-install-the-subversion-version-control-system"><span class="header-section-number">4</span> Become root, and install the Subversion Version Control System:</h1>
74<p>In addition to Subversion we will specify to install telnet and the mutt email client. Both these package may already be installed from prior exercises. If so, don't worry - the apt-get command will not reinstall them.</p>
75<pre><code>$ sudo -s
76# apt-get install subversion telnet mutt</code></pre>
77<h1 id="install-rancid-itself"><span class="header-section-number">5</span> Install Rancid itself</h1>
78<pre><code># apt-get install rancid</code></pre>
79<ul>
80<li>It will prompt with a warning - Select <OK> and press ENTER to continue.</li>
81<li>It will give you another warning about making a backup copy of your rancid data. We have no data, so select <YES> and press ENTER to continue.</li>
82</ul>
83<h1 id="add-an-alias-for-the-rancid-user-in-etcaliases-file"><span class="header-section-number">6</span> Add an alias for the rancid user in /etc/aliases file</h1>
84<ul>
85<li>RANCID by default sends emails to the users rancid-groupname and rancid-admin-groupname. We want them to be sent to the sysadm user instead and use the alias function for this.</li>
86</ul>
87<pre><code># editor /etc/aliases</code></pre>
88<pre><code>rancid-routers:         sysadm
89rancid-admin-routers:   sysadm</code></pre>
90<p>Save the file, then run:</p>
91<pre><code># newaliases</code></pre>
92<h1 id="edit-etcrancidrancid.conf"><span class="header-section-number">7</span> Edit /etc/rancid/rancid.conf</h1>
93<pre><code># editor /etc/rancid/rancid.conf</code></pre>
94<p>Find these lines in rancid.conf:</p>
95<pre><code># list of rancid groups
96#LIST_OF_GROUPS=&quot;sl joebobisp&quot;; export LIST_OF_GROUPS</code></pre>
97<p>And, underneath them add the following line:</p>
98<pre><code>LIST_OF_GROUPS=&quot;routers&quot;</code></pre>
99<p>(with no '#' at the front of line, and aligned to the left)</p>
100<p>Find the line with CVSROOT:</p>
101<pre><code>CVSROOT=$BASEDIR/CVS; export CVSROOT</code></pre>
102<p>And, change it to:</p>
103<pre><code>CVSROOT=$BASEDIR/svn; export CVSROOT</code></pre>
104<p>Note the lowercase &quot;svn&quot;.</p>
105<p>We want to use Subversion for our Version Control System, and not CVS, so find the line with the parameter RCSSYS:</p>
106<pre><code>RCSSYS=cvs; export RCSSYS</code></pre>
107<p>And, change it to:</p>
108<pre><code>RCSSYS=svn; export RCSSYS</code></pre>
109<p>Now exit and save the file.</p>
110<h1 id="change-to-the-rancid-user"><span class="header-section-number">8</span> Change to the rancid user</h1>
111<h1 id="critical-critical-critical"><span class="header-section-number">9</span> CRITICAL! CRITICAL! CRITICAL!</h1>
112<h1 id="critical-critical-critical-1"><span class="header-section-number">10</span> CRITICAL! CRITICAL! CRITICAL!</h1>
113<h1 id="critical-critical-critical-2"><span class="header-section-number">11</span> CRITICAL! CRITICAL! CRITICAL!</h1>
114<p>Pay very close attention to what userid you are using during the rest of these exercises. If you are not sure simply type &quot;id&quot; on the command line at any time.</p>
115<p>From a root prompt (&quot;#&quot;), switch identity to become the 'rancid' user:</p>
116<pre><code># su -s /bin/bash rancid</code></pre>
117<p>Check that you ARE the rancid user:</p>
118<pre><code>$ id</code></pre>
119<p>You should see something similar (numbers may be different):</p>
120<pre><code>        uid=104(rancid) gid=109(rancid) groups=109(rancid)</code></pre>
121<h1 id="if-you-are-not-user-rancid-now-do-not-continue"><span class="header-section-number">12</span> IF YOU ARE NOT USER RANCID NOW, do NOT continue</h1>
122<h1 id="create-varlibrancid.cloginrc"><span class="header-section-number">13</span> Create /var/lib/rancid/.cloginrc</h1>
123<pre><code>$ editor /var/lib/rancid/.cloginrc</code></pre>
124<p>Add the following two lines to the file:</p>
125<pre><code>add user *.ws.nsrc.org cisco
126add password *.ws.nsrc.org nsrc+ws nsrc+ws</code></pre>
127<p>(The first 'cisco' is the username, the first and second 'nsrc+ws' are the password and enable password used to login to your router. The star in the name means that it will try to use this username and password for all routers whose names end .ws.nsrc.org)</p>
128<p>Exit and save the file.</p>
129<p>Now protect this file so that it cannot be read by other users:</p>
130<pre><code>$ chmod 600 /var/lib/rancid/.cloginrc</code></pre>
131<h1 id="test-login-to-the-router-of-your-group"><span class="header-section-number">14</span> 8. Test login to the router of your group</h1>
132<p>Login to your router with clogin. You might have to type yes to the first warning, but should not need to enter a password, this should be automatic.</p>
133<pre><code>$ /var/lib/rancid/bin/clogin rtrX.ws.nsrc.org</code></pre>
134<p>(replace X with your group number. So, group 1 is rtr1.ws.nsrc.org)</p>
135<p>You should get something like:</p>
136<pre><code>      spawn ssh -c 3des -x -l cisco rtrX.ws.nsrc.org
137       The authenticity of host 'rtrX.ws.nsrc.org (10.10.X.254)' can't be established.
138       RSA key fingerprint is 73:f3:f0:e8:78:ab:49:1c:d9:5d:49:01:a4:e1:2a:83.
139       Are you sure you want to continue connecting (yes/no)?
140       Host rtrX.ws.nsrc.org added to the list of known hosts.
141       yes
142       Warning: Permanently added 'rtrX.ws.nsrc.org' (RSA) to the list of known hosts.
143       Password:
144
145       rtrX&gt;enable
146       Password:
147       rtrX#</code></pre>
148<p>Exit the from the router login:</p>
149<pre><code>       rtrX#exit</code></pre>
150<h1 id="initialize-the-svn-repository-for-rancid"><span class="header-section-number">15</span> Initialize the SVN repository for rancid:</h1>
151<p>Make sure you are the rancid user before doing this:</p>
152<pre><code>    $ id</code></pre>
153<p>If you do not see something like</p>
154<pre><code>uid=108(rancid) gid=113(rancid) groups=113(rancid)&quot;</code></pre>
155<p>then DO NOT CONTINUE until you have become the rancid user. See exercise 6 for details.</p>
156<p>Now initialize the Version Control repository (it will use Subversion):</p>
157<pre><code>        $ /usr/lib/rancid/bin/rancid-cvs</code></pre>
158<p>You should see something similar to this:</p>
159<pre><code>    Committed revision 1.
160    Checked out revision 1.
161    At revision 1.
162    A         configs
163    Adding         configs
164
165    Committed revision 2.
166    A         router.db
167    Adding         router.db
168    Transmitting file data .
169    Committed revision 3.</code></pre>
170<h1 id="do-this-only-if-you-have-problems"><span class="header-section-number">16</span> Do this ONLY if you have problems</h1>
171<p>If this does not work, then either you are missing the subversion package, or something was not properly configured during the previous steps. You should verify that subversion is installed and then before running the rancid-cvs command again do the following:</p>
172<pre><code>    $ exit
173    # apt-get install subversion
174    # su -s /bin/bash rancid
175    $ cd /var/lib/rancid
176    $ rm -rf routers
177    $ rm -rf svn</code></pre>
178<p>Now try running the rancid-cvs command again:</p>
179<pre><code>    $ /usr/lib/rancid/bin/rancid-cvs</code></pre>
180<hr />
181<h1 id="create-the-router.db-file"><span class="header-section-number">17</span> Create the router.db file</h1>
182<pre><code>        $ editor /var/lib/rancid/routers/router.db</code></pre>
183<p>Add this line (NO spaces at the beginning please):</p>
184<pre><code>rtrX.ws.nsrc.org:cisco:up</code></pre>
185<p>(remember to replace X as appropriate)</p>
186<p>Exit and save the file.</p>
187<h1 id="lets-run-rancid"><span class="header-section-number">18</span> Let's run rancid!</h1>
188<pre><code>       $ /usr/lib/rancid/bin/rancid-run</code></pre>
189<p>This may take some time so be patient.</p>
190<p>Run it again, since the first time it might not commit correctly:</p>
191<pre><code>        $ /usr/lib/rancid/bin/rancid-run</code></pre>
192<h1 id="check-the-rancid-log-files"><span class="header-section-number">19</span> Check the rancid log files:</h1>
193<pre><code>        $ cd /var/lib/rancid/logs
194        $ ls -l</code></pre>
195<p>... View the contents of the file(s):</p>
196<pre><code>        $ less routers.*</code></pre>
197<p>NOTE! Using &quot;less&quot; - to see the next file press &quot;:n&quot;. To see the Previous file press &quot;:p&quot;. To exit from less press &quot;q&quot;.</p>
198<h1 id="look-at-the-configs"><span class="header-section-number">20</span> Look at the configs</h1>
199<pre><code>        $ cd /var/lib/rancid/routers/configs
200        $ less rtrX.ws.nsrc.org</code></pre>
201<p>Where you should replace &quot;X&quot; with your group number.</p>
202<p>If all went well, you can see the config of the router.</p>
203<h1 id="lets-change-an-interface-description-on-the-router"><span class="header-section-number">21</span> Let's change an interface Description on the router</h1>
204<pre><code>        $ /usr/lib/rancid/bin/clogin rtrX.ws.nsrc.org</code></pre>
205<p>Where you should replace &quot;X&quot; with your group number.</p>
206<p>At the &quot;rtrX#&quot; prompt, enter the command:</p>
207<pre><code>        rtrX# conf term</code></pre>
208<p>You should see:</p>
209<pre><code>        Enter configuration commands, one per line.  End with CNTL/Z.
210        rtrX(config)#</code></pre>
211<p>Enter:</p>
212<pre><code>        rtrX(config)# interface LoopbackXX      (replace XX with your PC no)</code></pre>
213<p>You should get this prompt:</p>
214<pre><code>        rtrX(config-if)#</code></pre>
215<p>Enter:</p>
216<pre><code>        rtr2(config-if)# description &lt;put your name here&gt;
217        rtr2(config-if)# end</code></pre>
218<p>You should now have this prompt:</p>
219<pre><code>        rtrX#</code></pre>
220<p>To save the config to memory:</p>
221<pre><code>        rtrX# write memory</code></pre>
222<p>You should see:</p>
223<pre><code>        Building configuration...
224        [OK]</code></pre>
225<p>To exit type:</p>
226<pre><code>        rtrX# exit</code></pre>
227<pre><code>Now you should be back at your rancid user prompt on your system:</code></pre>
228<h1 id="lets-run-rancid-again"><span class="header-section-number">22</span> Let's run rancid again:</h1>
229<pre><code>        $ /usr/lib/rancid/bin/rancid-run</code></pre>
230<p>Look at the ranicd logs</p>
231<pre><code>        $ ls /var/lib/rancid/logs/</code></pre>
232<p>You should see the latest rancid execution as a new log file with the date and time in the name.</p>
233<h1 id="lets-see-the-differences"><span class="header-section-number">23</span> Let's see the differences</h1>
234<pre><code>        $ cd /var/lib/rancid/routers/configs
235        $ ls -l</code></pre>
236<p>You should see the router config file for your group:</p>
237<pre><code>        $ svn log rtrX.ws.nsrc.org</code></pre>
238<p>(where X is the number of your router)</p>
239<p>Notice the revisions. You should see different no's such as r5 and r7. Choose the lowest and the highest one.</p>
240<p>Let's view the difference between two versions:</p>
241<pre><code>        $ svn diff -r 5:7 rtrX.ws.nsrc.org | less
242        $ svn diff -r 6:7 rtrX.ws.nsrc.org | less</code></pre>
243<p>... can you find your changes?</p>
244<p>Notice that svn is the Subversion Version Control system command line tool for viewing Subversion repositories of information. If you type:</p>
245<pre><code>        $ ls -lah</code></pre>
246<p>You will see a hidden directory called &quot;.svn&quot; - this actually contains all the information about the changes between router configurations from each time you run rancid using /usr/lib/rancid/bin/rancid-run.</p>
247<p>Whatever you do, don't edit or touch the .svn directory by hand!</p>
248<h1 id="check-your-mail"><span class="header-section-number">24</span> Check your mail</h1>
249<p>Now we will exit from the rancid user shell and the root user shell to go back to being the &quot;sysadm&quot; user. Then we'll use the &quot;mutt&quot; email client to see if rancid has been sending emails to the sysadm user.</p>
250<pre><code>        $ exit                  (takes your from rancid to root user)
251        # exit                  (take you from root to sysadm user)
252        $ id
253        ... check that you are now the 'sysadm' user again;
254       
255        ... if not, log out and in again as sysadm to your virtual host
256       
257        $ mutt</code></pre>
258<p>(When asked to create the Mail directory, say Yes)</p>
259<p>If everything goes as planned, you should be able to read the mails sent by Rancid. You can select an email sent by &quot;rancid@pcX.ws.nsrc.org&quot; and see what it looks like.</p>
260<p>Notice that it is your router description and any differences from the last time it was obtained using the rancid-run command.</p>
261<p>Now exit from mutt.</p>
262<p>(use 'q' return to mail index, and 'q' again to quit mutt)</p>
263<h1 id="lets-make-rancid-run-automatically-every-30-minutes-from-using-cron"><span class="header-section-number">25</span> Let's make rancid run automatically every 30 minutes from using cron</h1>
264<p>cron is a system available in Linux to automate the running of jobs. First we need to become the root user again:</p>
265<pre><code>        $ sudo -s</code></pre>
266<p>Now we will create a new job to run for the rancid user:</p>
267<pre><code>        # crontab -e -u rancid</code></pre>
268<p>It will ask you for your favorite editor. Select whichever editor you have been using in class.</p>
269<p>Add this line at the bottom of the file (COPY and PASTE):</p>
270<pre><code>        */30  *  *  *  *  /usr/lib/rancid/bin/rancid-run</code></pre>
271<p>... then save and quit from the file.</p>
272<p>That's it. The command &quot;rancid-run&quot; will execute automatically from now on every 30 minutes all the time (every day, week and month).</p>
273<h1 id="now-add-all-the-other-routers"><span class="header-section-number">26</span> Now add all the other routers</h1>
274<p>Note the hostnames for the routers</p>
275<p>rtrX.ws.nsrc.org where X goes from 1 to 9</p>
276<p>If you have less routers in your class, then only include the actual, available routers.</p>
277<p>Become the rancid user and update the router.db file:</p>
278<pre><code>        # su -s /bin/bash rancid
279        $ editor /var/lib/rancid/routers/router.db</code></pre>
280<p>Add the other classroom routers to the file. You should end up with something like (COPY and PASTE):</p>
281<pre><code>rtr1.ws.nsrc.org:cisco:up
282rtr2.ws.nsrc.org:cisco:up
283rtr3.ws.nsrc.org:cisco:up
284rtr4.ws.nsrc.org:cisco:up
285rtr5.ws.nsrc.org:cisco:up
286rtr6.ws.nsrc.org:cisco:up
287rtr7.ws.nsrc.org:cisco:up
288rtr8.ws.nsrc.org:cisco:up
289rtr9.ws.nsrc.org:cisco:up</code></pre>
290<p>(Note that &quot;cisco&quot; means this is Cisco equipment -- it tells Rancid that we are expecting to talk to a Cisco device here. You can also talk to Juniper, HP, ...).</p>
291<p>Be sure the entries are aligned to the left of the file.</p>
292<h1 id="run-rancid-again"><span class="header-section-number">27</span> Run rancid again:</h1>
293<pre><code>        $ /usr/lib/rancid/bin/rancid-run</code></pre>
294<p>This should take a minute or more now, be patient.</p>
295<h1 id="check-out-the-logs"><span class="header-section-number">28</span> Check out the logs:</h1>
296<pre><code>        $ cd /var/lib/rancid/logs
297        $ ls -l</code></pre>
298<p>... Pick the latest file and view it</p>
299<pre><code>        $ less routers.YYYYMMDD.HHMMSS</code></pre>
300<p>This should be the last file listed in the output from &quot;ls -l&quot;</p>
301<p>You should notice a bunch of statements indicating that routers have been added to the Subversion version control repository, and much more.</p>
302<h1 id="look-at-the-configs-1"><span class="header-section-number">29</span> Look at the configs</h1>
303<pre><code>        $ cd /var/lib/rancid/routers/configs
304        $ more *.ws.nsrc.org</code></pre>
305<p>Press the SPACE bar to continue through each file. Or, you could do:</p>
306<pre><code>    $ less *.ws.nsrc.org</code></pre>
307<p>And press the SPACE bar to scroll through each file and then press &quot;:n&quot; to view the next file. Remember, in both cases you can press &quot;q&quot; to quit at any time.</p>
308<p>If all went well, you can see the configs of ALL routers</p>
309<h1 id="run-rancid-again-just-in-case-someone-changed-some-configuration-on-the-router"><span class="header-section-number">30</span> Run RANCID again just in case someone changed some configuration on the router</h1>
310<pre><code>        $ /usr/lib/rancid/bin/rancid-run</code></pre>
311<p>This could take a few moments, so be patient....</p>
312<h1 id="play-with-clogin"><span class="header-section-number">31</span> Play with clogin:</h1>
313<pre><code>        $  /usr/lib/rancid/bin/clogin -c &quot;show clock&quot; rtrX.ws.nsrc.org</code></pre>
314<p>Where &quot;X&quot; is the number of your group.</p>
315<p>What do you notice ?</p>
316<p>Even better, we can show the power of using a simple script to make changes to multiple devices quickly:</p>
317<pre><code>        $ editor /tmp/newuser</code></pre>
318<p>... in this file, add the following commands (COPY and PASTE):</p>
319<pre><code>configure terminal
320username NewUser secret 0 NewPassword
321exit
322write</code></pre>
323<p>Save the file, exit, and run the following commands from the command line:</p>
324<pre><code>    $ for r in 1 2 3 4
325   
326    Your prompt will now change to be &quot;&gt;&quot;. Continue by typing:
327   
328    &gt; do
329    &gt; /var/lib/rancid/bin/clogin -x /tmp/newuser rtr$r.ws.nsrc.org
330    &gt; done</code></pre>
331<p>Now your prompt will go back to &quot;$&quot; and rancid clogin command will run and execute the commands you just typed above on routers rtr1, rtr2, rtr3 and rtr4. This is simple shell scripting in Linux, but it's very powerful.</p>
332<p>Q. How would you verify that this has executed correctly ? Hint: &quot;show run | inc&quot;</p>
333<p>A. Connect to rtr1, rtr2, rtr3 and rtr4. Type &quot;enable&quot; and then type &quot;show run | inc username&quot; to verify that the NewUser username now exists. Type exit to leave each router. Naturally you could automate this like we just did above.</p>
334<h1 id="add-the-rancid-svn-subversion-repository-in-to-websvn"><span class="header-section-number">32</span> Add the RANCID SVN (Subversion) repository in to WebSVN</h1>
335<p>If you are still logged in as user rancid, get back to root. Remember you can type &quot;id&quot; to check what userid you are.</p>
336<pre><code>        $ exit
337        # </code></pre>
338<p>Install WebSVN:</p>
339<pre><code>        # apt-get install websvn</code></pre>
340<p>During the installation, follow the following instructions.</p>
341<ul>
342<li>Select <Yes> to the question if you want to configure WebSVN now and press ENTER</li>
343<li>Select <Ok> for the next question about supporting various web servers and press ENTER</li>
344<li>When asked for the &quot;svn parent repositories&quot; change the path to be:</li>
345</ul>
346<pre><code>              /var/lib/rancid/svn</code></pre>
347<p>Select <Ok> and press ENTER. Do the same when asked about &quot;svn repositories&quot; on the next screen. That is, use the path:</p>
348<pre><code>              /var/lib/rancid/svn</code></pre>
349<p>and not what is shown by default. Select <Ok> and press ENTER.</p>
350<p>Select <Ok> for the next screen talking about permissions and press ENTER.</p>
351<p>Note: if you are installing under Ubuntu 14.04, you may get an error about the <code>conf.d</code> directory not being present. If so, workaround the problem like this (including creating a dummy conf.d directory):</p>
352<pre><code># ln -s /etc/websvn/apache.conf /etc/apache2/conf-available/websvn.conf
353# mkdir /etc/apache2/conf.d
354# a2enconf websvn.conf
355# service apache2 reload</code></pre>
356<h1 id="fix-permissions.-the-web-server-must-be-able-to-read-the-svn-subversion-folder"><span class="header-section-number">33</span> Fix permissions. The web server must be able to read the SVN (Subversion) folder</h1>
357<pre><code>        # chgrp -R www-data /var/lib/rancid/svn
358        # chmod g+w -R /var/lib/rancid/svn</code></pre>
359<h1 id="browse-the-rancid-files-from-your-web-browser"><span class="header-section-number">34</span> Browse the rancid files from your Web browser!</h1>
360<pre><code>    http://pcX.ws.nsrc.org/websvn</code></pre>
361<p>Browse the files under the 'routers/configs' directory. You can see all your router configuration files here.</p>
362<h1 id="review-revisions"><span class="header-section-number">35</span> Review revisions</h1>
363<p>WebSVN lets you see easily the changes between versions.</p>
364<ul>
365<li>Browse to http://pcX.ws.nsrc.org/websvn again, go to routers/ then configs/</li>
366<li>Click on your router file (rtrX.ws.nsrc.org) name. You will get a new screen</li>
367<li>Click &quot;Compare with Previous&quot; at the top of the screen.</li>
368<li>You should now see the latest changes highlighted.<br /></li>
369<li>Click on &quot;REPOS 1&quot; to back to the main WebSVN page:</li>
370<li>Click on &quot;routers/&quot; under &quot;Path&quot;</li>
371<li>Click on &quot;configs/&quot;</li>
372<li>Select two of the routers that are next to each other. I.E. rtr1 and rtr2, rtr3 and rtr4.</li>
373<li>Click on Compare Paths</li>
374</ul>
375<p>This will show you the differences between two separate router configurations.</p>
376<p>WebSVN is a convenient way to quickly see differences via a GUI between mulitple configuration files. Note, this is a potential security hole so you should limit access to the URL http://host/websvn using passwords (and SSL) or appropriate access control lists.</p>
377<h1 id="optional-fetching-configs-with-a-non-privileged-rancid-user"><span class="header-section-number">36</span> Optional: Fetching configs with a non-privileged <code>rancid</code> user</h1>
378<p>In a production environment, we'd probably want to add a &quot;rancid&quot; user on the devices, without config privileges, but able to retrieve do a <code>show running-config</code>.</p>
379<p>One way to do this, add a user in config mode:</p>
380<pre><code>rtrX# conf term
381Enter configuration commands, one per line.  End with CNTL/Z.
382rtrX(config)# username rancid privilege 4 secret password
383rtrX(config)# privilege exec level 4 show running-config view full</code></pre>
384<p>This creates a <code>rancid</code> user with privilege level 4. On the next line, we allow that user to execute <code>show running-config</code></p>
385<p>You also need to add the username and password to your .cloginrc</p>
386<pre><code>add user *.ws.nsrc.org rancid
387+add password *.ws.nsrc.org password
388add autoenable *.ws.nsrc.org 1</code></pre>
389<p>The <code>autoenable</code> means the user will be in the right privilege level immediately after login and no enable is needed to run <code>show running-config</code></p>
390<p>Note: try and look at the <code>clogin</code> manpage to find out how you can specify another user (for example: cisco) when using clogin interactively, to make changes with -c or -x (as shown above).</p>
391<p>See more at: http://www.toms-blog.com/backup-cisco-config-with-rancid-and-an-un-priviledged-user/</p>
392<h1 id="on-the-use-of-hostnames-in-rancid-vs.-ip-addresses"><span class="header-section-number">37</span> On the use of hostnames in RANCID vs. IP Addresses</h1>
393<p>(Note: it is also allowed to use IP addresses, and one could also write:</p>
394<pre><code>       add user 10.10.* cisco
395       add password 10.10.* nsrc+ws nsrc+ws
396       add user rtr*.ws.nsrc.org cisco
397       add password rtr*.ws.nsrc.org nsrc+ws nsrc+ws</code></pre>
398</body>
399</html>