Agenda: rancid-exercise.htm

File rancid-exercise.htm, 45.5 KB (added by admin, 6 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>Using RANCID</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">Using RANCID</h1>
14</div>
15<div id="TOC">
16<ul>
17<li><a href="#introduction"><span class="toc-section-number">1</span> Introduction</a><ul>
18<li><a href="#goals"><span class="toc-section-number">1.1</span> Goals</a></li>
19<li><a href="#notes"><span class="toc-section-number">1.2</span> Notes</a></li>
20</ul></li>
21<li><a href="#install-rancid"><span class="toc-section-number">2</span> Install rancid</a><ul>
22<li><a href="#add-alias"><span class="toc-section-number">2.1</span> Add alias</a></li>
23<li><a href="#configure-rancid"><span class="toc-section-number">2.2</span> Configure rancid</a></li>
24</ul></li>
25<li><a href="#change-to-the-rancid-user"><span class="toc-section-number">3</span> Change to the rancid user</a><ul>
26<li><a href="#create-varlibrancid.cloginrc"><span class="toc-section-number">3.1</span> Create <code>/var/lib/rancid/.cloginrc</code></a></li>
27<li><a href="#test-login-to-the-router-of-your-group"><span class="toc-section-number">3.2</span> Test login to the router of your group</a></li>
28<li><a href="#initialize-the-svn-repository-for-rancid"><span class="toc-section-number">3.3</span> Initialize the SVN repository for rancid</a></li>
29<li><a href="#create-the-router.db-file"><span class="toc-section-number">3.4</span> Create the router.db file</a></li>
30<li><a href="#lets-run-rancid"><span class="toc-section-number">3.5</span> Let's run rancid!</a></li>
31<li><a href="#check-the-rancid-log-files"><span class="toc-section-number">3.6</span> Check the rancid log files:</a></li>
32<li><a href="#look-at-the-configs"><span class="toc-section-number">3.7</span> Look at the configs</a></li>
33</ul></li>
34<li><a href="#tracking-changes"><span class="toc-section-number">4</span> Tracking changes</a><ul>
35<li><a href="#lets-run-rancid-again"><span class="toc-section-number">4.1</span> Let's run rancid again</a></li>
36<li><a href="#lets-see-the-differences"><span class="toc-section-number">4.2</span> Let's see the differences</a></li>
37<li><a href="#check-your-mail"><span class="toc-section-number">4.3</span> Check your mail</a></li>
38</ul></li>
39<li><a href="#cron-configuration"><span class="toc-section-number">5</span> Cron configuration</a></li>
40<li><a href="#more-routers"><span class="toc-section-number">6</span> More routers</a><ul>
41<li><a href="#look-at-the-configs-1"><span class="toc-section-number">6.1</span> Look at the configs</a></li>
42<li><a href="#re-run-rancid"><span class="toc-section-number">6.2</span> Re-run rancid</a></li>
43<li><a href="#play-with-clogin"><span class="toc-section-number">6.3</span> Play with clogin</a></li>
44</ul></li>
45<li><a href="#install-websvn"><span class="toc-section-number">7</span> Install WebSVN</a><ul>
46<li><a href="#review-revisions"><span class="toc-section-number">7.1</span> Review revisions</a></li>
47</ul></li>
48<li><a href="#notes-1"><span class="toc-section-number">8</span> Notes</a><ul>
49<li><a href="#on-the-use-of-hostnames-in-rancid-vs.-ip-addresses"><span class="toc-section-number">8.1</span> On the use of hostnames in RANCID vs. IP Addresses</a></li>
50</ul></li>
51</ul>
52</div>
53<h1 id="introduction"><a href="#introduction"><span class="header-section-number">1</span> Introduction</a></h1>
54<h2 id="goals"><a href="#goals"><span class="header-section-number">1.1</span> Goals</a></h2>
55<ul>
56<li>Gain experience with RANCID</li>
57</ul>
58<h2 id="notes"><a href="#notes"><span class="header-section-number">1.2</span> Notes</a></h2>
59<ul>
60<li>Commands preceded with &quot;$&quot; imply that you should execute the command as a general user - not as root.</li>
61<li>Commands preceded with &quot;#&quot; imply that you should be working as root.</li>
62<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>
63</ul>
64<h1 id="install-rancid"><a href="#install-rancid"><span class="header-section-number">2</span> Install rancid</a></h1>
65<p>Connect to your PC using ssh, and become root:</p>
66<pre><code>$ sudo -s
67#</code></pre>
68<p>Now install the Subversion Version Control System:</p>
69<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>
70<pre><code># apt-get install subversion telnet mutt</code></pre>
71<p>Install rancid itself:</p>
72<pre><code># apt-get install rancid</code></pre>
73<ul>
74<li>It will prompt with a warning - Select <code>&lt;OK&gt;</code> and press ENTER to continue.</li>
75<li>It will give you another warning about making a backup copy of your rancid data. We have no data, so select <code>&lt;YES&gt;</code> and press ENTER to continue.</li>
76</ul>
77<h2 id="add-alias"><a href="#add-alias"><span class="header-section-number">2.1</span> Add alias</a></h2>
78<p>Add an alias for the rancid user in <code>/etc/aliases</code> file</p>
79<blockquote>
80<p>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.</p>
81</blockquote>
82<pre><code># editor /etc/aliases</code></pre>
83<p>Add the following entries.</p>
84<pre><code>rancid-routers:         sysadm
85rancid-admin-routers:   sysadm</code></pre>
86<p>Save the file, then run:</p>
87<pre><code># newaliases</code></pre>
88<h2 id="configure-rancid"><a href="#configure-rancid"><span class="header-section-number">2.2</span> Configure rancid</a></h2>
89<p>Edit <code>/etc/rancid/rancid.conf</code></p>
90<pre><code># editor /etc/rancid/rancid.conf</code></pre>
91<p>Find these lines in rancid.conf:</p>
92<pre><code># list of rancid groups
93#LIST_OF_GROUPS=&quot;sl joebobisp&quot;; export LIST_OF_GROUPS</code></pre>
94<p>And, underneath them add the following line:</p>
95<pre><code>LIST_OF_GROUPS=&quot;routers&quot;</code></pre>
96<p>(with no '#' at the front of line, and aligned to the left)</p>
97<p>Find the line with CVSROOT:</p>
98<pre><code>CVSROOT=$BASEDIR/CVS; export CVSROOT</code></pre>
99<p>And, change it to:</p>
100<pre><code>CVSROOT=$BASEDIR/svn; export CVSROOT</code></pre>
101<p>Note the lowercase &quot;svn&quot;.</p>
102<p>We want to use Subversion for our Version Control System, and not CVS, so find the line with the parameter RCSSYS:</p>
103<pre><code>RCSSYS=cvs; export RCSSYS</code></pre>
104<p>And, change it to:</p>
105<pre><code>RCSSYS=svn; export RCSSYS</code></pre>
106<p>Now exit and save the file.</p>
107<h1 id="change-to-the-rancid-user"><a href="#change-to-the-rancid-user"><span class="header-section-number">3</span> Change to the rancid user</a></h1>
108<blockquote>
109<p>CRITICAL! CRITICAL! CRITICAL!</p>
110<p>CRITICAL! CRITICAL! CRITICAL!</p>
111<p><blink> CRITICAL! CRITICAL! CRITICAL! </blink></p>
112</blockquote>
113<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>
114<p>From a root prompt (&quot;#&quot;), switch identity to become the 'rancid' user:</p>
115<pre><code># su -s /bin/bash rancid</code></pre>
116<p>Check that you ARE the rancid user:</p>
117<pre><code>$ id</code></pre>
118<p>You should see something similar (numbers may be different):</p>
119<pre><code>uid=104(rancid) gid=109(rancid) groups=109(rancid)</code></pre>
120<p><strong>IF YOU ARE NOT USER RANCID NOW, do NOT continue</strong></p>
121<h2 id="create-varlibrancid.cloginrc"><a href="#create-varlibrancid.cloginrc"><span class="header-section-number">3.1</span> Create <code>/var/lib/rancid/.cloginrc</code></a></h2>
122<pre><code>$ editor /var/lib/rancid/.cloginrc</code></pre>
123<p>Add the following two lines to the file:</p>
124<pre><code>add user *.ws.nsrc.org cisco
125add password *.ws.nsrc.org nsrc+ws nsrc+ws</code></pre>
126<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>
127<p>Exit and save the file.</p>
128<p>Now protect this file so that it cannot be read by other users:</p>
129<pre><code>$ chmod 600 /var/lib/rancid/.cloginrc</code></pre>
130<h2 id="test-login-to-the-router-of-your-group"><a href="#test-login-to-the-router-of-your-group"><span class="header-section-number">3.2</span> Test login to the router of your group</a></h2>
131<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>
132<pre><code>$ /var/lib/rancid/bin/clogin rtrX.ws.nsrc.org</code></pre>
133<p>(replace X with your group number. So, group 1 is rtr1.ws.nsrc.org)</p>
134<p>You should get something like:</p>
135<pre><code>spawn ssh -c 3des -x -l cisco rtrX.ws.nsrc.org
136The authenticity of host 'rtrX.ws.nsrc.org (10.10.X.254)' can't be established.
137RSA key fingerprint is 73:f3:f0:e8:78:ab:49:1c:d9:5d:49:01:a4:e1:2a:83.
138Are you sure you want to continue connecting (yes/no)?
139Host rtrX.ws.nsrc.org added to the list of known hosts.
140yes
141Warning: Permanently added 'rtrX.ws.nsrc.org' (RSA) to the list of known hosts.
142Password:
143
144rtrX&gt;enable
145Password:
146rtrX#</code></pre>
147<p>Exit the from the router login:</p>
148<pre><code>rtrX#exit</code></pre>
149<h2 id="initialize-the-svn-repository-for-rancid"><a href="#initialize-the-svn-repository-for-rancid"><span class="header-section-number">3.3</span> Initialize the SVN repository for rancid</a></h2>
150<p>Make sure you are the rancid user before doing this:</p>
151<pre><code>$ id</code></pre>
152<p>If you do not see something like</p>
153<pre><code>uid=104(rancid) gid=109(rancid) groups=109(rancid)</code></pre>
154<p>then DO NOT CONTINUE until you have become the rancid user. See earlier section for details.</p>
155<p>Now initialize the Version Control repository (it will use Subversion):</p>
156<pre><code>$ /usr/lib/rancid/bin/rancid-cvs</code></pre>
157<p>You should see something similar to this:</p>
158<pre><code>Committed revision 1.
159Checked out revision 1.
160At revision 1.
161A         configs
162Adding         configs
163
164Committed revision 2.
165A         router.db
166Adding         router.db
167Transmitting file data .
168Committed revision 3.</code></pre>
169<hr />
170<blockquote>
171<p><strong>Do the following ONLY if you have problems</strong></p>
172<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>
173<pre><code>$ exit
174# apt-get install subversion
175# su -s /bin/bash rancid
176$ cd /var/lib/rancid
177$ rm -rf routers
178$ rm -rf svn</code></pre>
179<p>Now try running the rancid-cvs command again:</p>
180<pre><code>$ /usr/lib/rancid/bin/rancid-cvs</code></pre>
181</blockquote>
182<hr />
183<h2 id="create-the-router.db-file"><a href="#create-the-router.db-file"><span class="header-section-number">3.4</span> Create the router.db file</a></h2>
184<pre><code>$ editor /var/lib/rancid/routers/router.db</code></pre>
185<p>Add this line (NO spaces at the beginning please):</p>
186<pre><code>rtrX.ws.nsrc.org:cisco:up</code></pre>
187<p>(remember to replace X as appropriate)</p>
188<p>Exit and save the file.</p>
189<h2 id="lets-run-rancid"><a href="#lets-run-rancid"><span class="header-section-number">3.5</span> Let's run rancid!</a></h2>
190<p>Still as the rancid user:</p>
191<pre><code>$ /usr/lib/rancid/bin/rancid-run</code></pre>
192<p>This may take some time so be patient.</p>
193<p>Run it again, since the first time it might not commit correctly:</p>
194<pre><code>$ /usr/lib/rancid/bin/rancid-run</code></pre>
195<h2 id="check-the-rancid-log-files"><a href="#check-the-rancid-log-files"><span class="header-section-number">3.6</span> Check the rancid log files:</a></h2>
196<pre><code>$ cd /var/lib/rancid/logs
197$ ls -l</code></pre>
198<p>... View the contents of the file(s):</p>
199<pre><code>$ less routers.*</code></pre>
200<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>
201<h2 id="look-at-the-configs"><a href="#look-at-the-configs"><span class="header-section-number">3.7</span> Look at the configs</a></h2>
202<pre><code>$ cd /var/lib/rancid/routers/configs
203$ less rtrX.ws.nsrc.org</code></pre>
204<p>Where you should replace &quot;X&quot; with your group number.</p>
205<p>If all went well, you can see the config of the router.</p>
206<h1 id="tracking-changes"><a href="#tracking-changes"><span class="header-section-number">4</span> Tracking changes</a></h1>
207<p>Let's change an interface Description on the router</p>
208<pre><code>$ /usr/lib/rancid/bin/clogin rtrX.ws.nsrc.org</code></pre>
209<p>Where you should replace &quot;X&quot; with your group number.</p>
210<p>At the &quot;rtrX#&quot; prompt, enter the command:</p>
211<pre><code>rtrX# conf term</code></pre>
212<p>You should see:</p>
213<pre><code>Enter configuration commands, one per line.  End with CNTL/Z.
214rtrX(config)#</code></pre>
215<p>Enter:</p>
216<pre><code>rtrX(config)# interface LoopbackXX      (replace XX with your PC no)</code></pre>
217<p>You should get this prompt:</p>
218<pre><code>rtrX(config-if)#</code></pre>
219<p>Enter:</p>
220<pre><code>rtrX(config-if)# description &lt;put your name here&gt;
221rtrX(config-if)# end</code></pre>
222<p>You should now have this prompt:</p>
223<pre><code>rtrX#</code></pre>
224<p>To save the config to memory:</p>
225<pre><code>rtrX# write memory</code></pre>
226<p>You should see:</p>
227<pre><code>Building configuration...
228[OK]</code></pre>
229<p>To exit type:</p>
230<pre><code>rtrX# exit</code></pre>
231<p>Now you should be back at your rancid user prompt on your system:</p>
232<h2 id="lets-run-rancid-again"><a href="#lets-run-rancid-again"><span class="header-section-number">4.1</span> Let's run rancid again</a></h2>
233<pre><code>$ /usr/lib/rancid/bin/rancid-run</code></pre>
234<p>Look at the rancid logs</p>
235<pre><code>$ ls /var/lib/rancid/logs/</code></pre>
236<p>You should see the latest rancid execution as a new log file with the date and time in the name.</p>
237<h2 id="lets-see-the-differences"><a href="#lets-see-the-differences"><span class="header-section-number">4.2</span> Let's see the differences</a></h2>
238<pre><code>$ cd /var/lib/rancid/routers/configs
239$ ls -l</code></pre>
240<p>You should see the router config file for your group:</p>
241<pre><code>$ svn log rtrX.ws.nsrc.org</code></pre>
242<p>(where X is the number of your router)</p>
243<p>Notice the revisions. You should see different revision numbers such as r5 and r7. Choose the lowest and the highest one.</p>
244<p>Let's view the difference between two versions:</p>
245<pre><code>$ svn diff -r5:7 rtrX.ws.nsrc.org | less
246$ svn diff -r6:7 rtrX.ws.nsrc.org | less</code></pre>
247<p>... can you find your changes?</p>
248<p>Notice that svn is the Subversion Version Control system command line tool for viewing Subversion repositories of information. If you type:</p>
249<pre><code>$ cd /var/lib/rancid/routers
250$ ls -lah</code></pre>
251<p>You will see a hidden directory called <code>.svn</code> - 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>
252<p>Whatever you do, don't edit or touch the <code>.svn</code> directory by hand!</p>
253<h2 id="check-your-mail"><a href="#check-your-mail"><span class="header-section-number">4.3</span> Check your mail</a></h2>
254<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>
255<pre><code>$ exit                  (takes your from rancid to root user)
256# exit                  (take you from root to sysadm user)
257$ id
258... check that you are now the 'sysadm' user again;
259
260... if not, log out and in again as sysadm to your virtual host
261
262$ mutt</code></pre>
263<p>(When asked to create the Mail directory, say Yes)</p>
264<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>
265<p>Notice that it is your router description and any differences from the last time it was obtained using the rancid-run command.</p>
266<p>Now exit from mutt.</p>
267<p>(use 'q' return to mail index, and 'q' again to quit mutt)</p>
268<h1 id="cron-configuration"><a href="#cron-configuration"><span class="header-section-number">5</span> Cron configuration</a></h1>
269<p>Let's make rancid run automatically every 30 minutes from using cron</p>
270<p>cron is a system available in Linux to automate the running of jobs. First we need to become the root user again:</p>
271<pre><code>$ sudo -s
272#</code></pre>
273<p>Now create or edit a file <code>/etc/cron.d/rancid</code> with the following contents:</p>
274<pre><code>*/30 * * * * rancid /usr/lib/rancid/bin/rancid-run</code></pre>
275<p>If this file already exists then add this line and leave the rest commented out.</p>
276<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>
277<h1 id="more-routers"><a href="#more-routers"><span class="header-section-number">6</span> More routers</a></h1>
278<p>Now add all the other routers. Note the hostnames:</p>
279<ul>
280<li>rtrX.ws.nsrc.org (where X goes from 1 to 9)</li>
281</ul>
282<p>If you have fewer routers in your class, then only include the actual, available routers.</p>
283<p>Become the rancid user and update the router.db file:</p>
284<pre><code># su -s /bin/bash rancid
285$ editor /var/lib/rancid/routers/router.db</code></pre>
286<p>Add the other classroom routers to the file. You should end up with something like (COPY and PASTE):</p>
287<pre><code>rtr1.ws.nsrc.org:cisco:up
288rtr2.ws.nsrc.org:cisco:up
289rtr3.ws.nsrc.org:cisco:up
290rtr4.ws.nsrc.org:cisco:up
291rtr5.ws.nsrc.org:cisco:up
292rtr6.ws.nsrc.org:cisco:up
293rtr7.ws.nsrc.org:cisco:up
294rtr8.ws.nsrc.org:cisco:up
295rtr9.ws.nsrc.org:cisco:up</code></pre>
296<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>
297<p>Be sure the entries are aligned to the left of the file.</p>
298<p>Run rancid again (still as the 'rancid' user)</p>
299<pre><code>$ /usr/lib/rancid/bin/rancid-run</code></pre>
300<p>This should take a minute or more now, be patient.</p>
301<p>Check out the logs:</p>
302<pre><code>$ cd /var/lib/rancid/logs
303$ ls -l</code></pre>
304<p>... Pick the latest file and view it</p>
305<pre><code>$ less routers.YYYYMMDD.HHMMSS</code></pre>
306<p>This should be the last file listed in the output from &quot;ls -l&quot;</p>
307<p>You should notice a bunch of statements indicating that routers have been added to the Subversion version control repository, and much more.</p>
308<h2 id="look-at-the-configs-1"><a href="#look-at-the-configs-1"><span class="header-section-number">6.1</span> Look at the configs</a></h2>
309<pre><code>$ cd /var/lib/rancid/routers/configs
310$ less *.ws.nsrc.org</code></pre>
311<p>Press the SPACE bar to scroll through each file and then press &quot;:n&quot; to view the next file. Press &quot;q&quot; to quit at any time.</p>
312<p>If all went well, you can see the configs of ALL routers</p>
313<h2 id="re-run-rancid"><a href="#re-run-rancid"><span class="header-section-number">6.2</span> Re-run rancid</a></h2>
314<p>Run RANCID again just in case someone changed some configuration on the router</p>
315<pre><code>$ /usr/lib/rancid/bin/rancid-run</code></pre>
316<p>This could take a few moments, so be patient....</p>
317<h2 id="play-with-clogin"><a href="#play-with-clogin"><span class="header-section-number">6.3</span> Play with clogin</a></h2>
318<pre><code>$ /usr/lib/rancid/bin/clogin -c &quot;show clock&quot; rtrX.ws.nsrc.org</code></pre>
319<p>Where &quot;X&quot; is the number of your group.</p>
320<p>What do you notice ?</p>
321<p>Even better, we can show the power of using a simple script to make changes to multiple devices quickly:</p>
322<pre><code>$ editor /tmp/newuser</code></pre>
323<p>... in this file, add the following commands (COPY and PASTE):</p>
324<pre><code>configure terminal
325username NewUser secret 0 NewPassword
326end
327write</code></pre>
328<p>Save the file, exit, and run the following commands from the command line:</p>
329<pre><code>$ for r in 1 2 3 4
330
331Your prompt will now change to be &quot;&gt;&quot;. Continue by typing:
332
333&gt; do
334&gt; /var/lib/rancid/bin/clogin -x /tmp/newuser rtr$r.ws.nsrc.org
335&gt; done</code></pre>
336<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>
337<p>Q. How would you verify that this has executed correctly ? Hint: &quot;show run | inc&quot;</p>
338<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>
339<h1 id="install-websvn"><a href="#install-websvn"><span class="header-section-number">7</span> Install WebSVN</a></h1>
340<p>Now we will add the RANCID SVN (Subversion) repository in to WebSVN so that you can browse configurations via the web.</p>
341<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>
342<pre><code>$ exit
343#</code></pre>
344<p>Install WebSVN:</p>
345<pre><code># apt-get install websvn</code></pre>
346<p>During the installation, follow the following instructions.</p>
347<ul>
348<li>Select <code>&lt;Yes&gt;</code> to the question if you want to configure WebSVN now and press ENTER</li>
349<li>Select <code>&lt;Ok&gt;</code> for the next question about supporting various web servers and press ENTER</li>
350<li>When asked for the &quot;svn parent repositories&quot; change the path to be:</li>
351</ul>
352<pre><code>/var/lib/rancid/svn</code></pre>
353<p>Select <code>&lt;Ok&gt;</code> and press ENTER. Do the same when asked about &quot;svn repositories&quot; on the next screen. That is, use the path:</p>
354<pre><code>/var/lib/rancid/svn</code></pre>
355<p>and not what is shown by default. Select <code>&lt;Ok&gt;</code> and press ENTER.</p>
356<p>Select <code>&lt;Ok&gt;</code> for the next screen talking about permissions and press ENTER.</p>
357<blockquote>
358<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>
359<pre><code># ln -s /etc/websvn/apache.conf /etc/apache2/conf-available/websvn.conf
360# mkdir /etc/apache2/conf.d
361# a2enconf websvn.conf
362# service apache2 reload</code></pre>
363</blockquote>
364<p>Now fix permissions. The web server must be able to read the SVN (Subversion) folder</p>
365<pre><code># chgrp -R www-data /var/lib/rancid/svn
366# chmod g+w -R /var/lib/rancid/svn</code></pre>
367<p>Browse the rancid files from your Web browser!</p>
368<ul>
369<li><a href="http://pcX.ws.nsrc.org/websvn">http://pcX.ws.nsrc.org/websvn</a></li>
370</ul>
371<p>Browse the files under the 'routers/configs' directory. You can see all your router configuration files here.</p>
372<h2 id="review-revisions"><a href="#review-revisions"><span class="header-section-number">7.1</span> Review revisions</a></h2>
373<p>WebSVN lets you see easily the changes between versions.</p>
374<ul>
375<li>Browse to <a href="http://pcX.ws.nsrc.org/websvn">http://pcX.ws.nsrc.org/websvn</a> again, go to routers/ then configs/</li>
376<li>Click on your router file (rtrX.ws.nsrc.org) name. You will get a new screen</li>
377<li>Click &quot;Compare with Previous&quot; at the top of the screen.</li>
378<li>You should now see the latest changes highlighted.</li>
379<li>Click on &quot;REPOS 1&quot; to back to the main WebSVN page:</li>
380<li>Click on &quot;routers/&quot; under &quot;Path&quot;</li>
381<li>Click on &quot;configs/&quot;</li>
382<li>Select two of the routers that are next to each other. I.E. rtr1 and rtr2, rtr3 and rtr4.</li>
383<li>Click on Compare Paths</li>
384</ul>
385<p>This will show you the differences between two separate router configurations.</p>
386<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>
387<!-- This doesn't work ("show running-config" is rejected)
388# Optional: Fetching configs with a non-privileged `rancid` user
389
390In a production environment, we'd probably want to add a
391"rancid" user on the devices, without config privileges, but able to
392retrieve do a `show running-config`.
393
394One way to do this, add a user in config mode:
395
396~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
397rtrX# conf term
398Enter configuration commands, one per line.  End with CNTL/Z.
399rtrX(config)# username rancid privilege 4 secret password
400rtrX(config)# privilege exec level 4 show running-config view full
401~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
402
403This creates a `rancid` user with privilege level 4.
404On the next line, we allow that user to execute `show running-config`
405
406You also need to add the username and password to your .cloginrc
407
408~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
409add user *.ws.nsrc.org rancid
410add password *.ws.nsrc.org password
411add autoenable *.ws.nsrc.org 1
412~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
413
414The `autoenable` means the user will be in the right privilege level
415immediately after login and no enable is needed to run `show running-config`
416
417Note: try and look at the `clogin` manpage to find out how you can
418specify another user (for example: cisco) when using clogin interactively,
419to make changes with -c or -x (as shown above).
420
421See more at <http://www.toms-blog.com/backup-cisco-config-with-rancid-and-an-un-priviledged-user/>
422-->
423
424<h1 id="notes-1"><a href="#notes-1"><span class="header-section-number">8</span> Notes</a></h1>
425<h2 id="on-the-use-of-hostnames-in-rancid-vs.-ip-addresses"><a href="#on-the-use-of-hostnames-in-rancid-vs.-ip-addresses"><span class="header-section-number">8.1</span> On the use of hostnames in RANCID vs. IP Addresses</a></h2>
426<p>Note: it is also allowed to use IP addresses, and one could also write:</p>
427<pre><code>add user 10.10.* cisco
428add password 10.10.* nsrc+ws nsrc+ws
429add user rtr*.ws.nsrc.org cisco
430add password rtr*.ws.nsrc.org nsrc+ws nsrc+ws</code></pre>
431</body>
432</html>