Vyatta Suite200 1301ShorewayRoad Belmont,CA94002 vyatta.com 6504137200 1888VYATTA1(USandCanada) VYATTA,INC. | VyattaSystem BasicRouting REFERENCEGUIDE ForwardingandRouting StaticRoutes COPYRIGHT Copyright©2005–2012Vyatta,Inc.Allrightsreserved. Vyattareservestherighttomakechangestosoftware,hardware,anddocumentationwithoutnotice.Forthemostrecentversionof documentation,visittheVyattawebsiteatvyatta.com. PROPRIETARYNOTICES VyattaisaregisteredtrademarkofVyatta,Inc. Hyper‐VisaregisteredtrademarkofMicrosoftCorporation. VMware,VMwareESX,andVMwareserveraretrademarksofVMware,Inc. XenServer,andXenCenteraretrademarksofCitrixSystems,Inc. Allothertrademarksarethepropertyoftheirrespectiveowners. RELEASEDATE:October2012 DOCUMENTREVISION.6.5R1 v01 RELEASEDWITH:6.5R1 PARTNO.A0‐0215‐10‐0016 iii BasicRouting 6.5R1v01 Vyatta Contents QuickListofCommands......................................................... v ListofExamples ............................................................... vii Preface. ....................................................................viii IntendedAudience ................. ................... ...........................................ix OrganizationofThisGuide ........... ...... .................................... ................. .. .ix DocumentConventions ........................... ............... ..................................x VyattaPublicati ons.............. .................................................................xi Chapter1ForwardingandRouting ............................................... 1 ForwardingandRoutingCommands ................................................................ .2 clearipprefix‐list............................. ................................................4 clearipv6 prefix‐list............... ................... .........................................5 ping<host> ................. ..... .................................................... ........6 resetiproutecache ...................................... ................................. ....8 resetipv6routecache.......... ................................. ..............................9 showipforwarding .................................. ........................................10 showiproute ..... ... ............... ................... .....................................11 showiproute<ipv4net>longer‐prefixes......................... ................................13 showiproutecache............... ................................. ..........................14 showiprouteconnected................. ..................... ................................16 showiprouteforward............... ............... ................... .................... ...17 showiproutekernel....................... ................. ................................. 19 showiproutestatic .............. ................................. ...........................20 showiproutesummary..................................... ............... ................... 21 showiproutesupernets‐only ............ ............... .......................................22 showiproutetable<table> .......................................... .........................23 showipv6route ....................... ................................. .....................24 showipv6route<ipv6net>longer‐prefixes......................................... ..............25 showipv6routebgp ................................ ............... ................... .......26 showipv6routecache...... ............... ................... ................. ...............27 showipv6routeconnected................................ ................................. ...28 showipv6routeforward........... ................................. ..........................29 showipv6routekernel............................. ........ ............... ................... 30 showipv6routeripng............ ............... ................... ..........................31 showipv6routestatic ..................... ................. ..................................32 iv BasicRouting 6.5R1v01 Vyatta showipv6routesummary.....................................................................33 showmonitoringprotocolsrib .......................... .................................... ...34 showtable ......... ................................. .................... ................... 35 traceroute<host> .......................... ............... ................... ...............36 Chapter2StaticRoutes ........................................................ 37 StaticRouteConfiguration................................................... .....................38 StaticRoutesOverview........ ............... ................................. ...............38 ConfiguringStatic Routes ........................................ .............................38 FloatingStaticRoutes ..... ...................... ................................ .. ...........40 ShowingStaticRoutesinthe RoutingTable ...................... ................... .............40 StaticIPv6RouteConfiguration ......... ................................. ..........................40 VerifyThatIPv6ForwardingisEnabled.................. ................................. .......41 AddtheDefaultIPv6Route...... ................................. .............................42 AddaStaticIPv6Route .................................. ................................ .. ...43 ConfirmConnectivity ............ ................................ .. ................. ..........43 StaticRouteCommands..... ................................ .....................................45 protocolsstaticinterface‐route<subnet>next‐hop‐interface<interface> .... .........................46 protocolsstaticinterface‐route6<subnet>next‐hop‐interface<ethx>........ ........ ................48 protocolsstaticroute<subnet>blackhole ............................. ..........................50 protocolsstaticroute<subnet>next‐hop<address>.................. .............................52 protocolsstaticroute6<subnet>blackhole . .. ............. ................................. .....54 protocolsstaticroute6<subnet>next‐hop<address>...... ................................. .......56 protocolsstatictable<table>interface‐route<subnet>next‐hop‐interface <interface> .................58 protocolsstatictable<table>interface‐route6<subnet>next‐hop‐interface<ethx> ....................60 protocolsstatictable<table>route<subnet> blackhole ............................................62 protocolsstatictable<table>route<subnet> next‐hop<address> ................... ................64 protocolsstatictable<table>route6<subnet> blackhole...........................................66 protocolsstatictable<table>route6<subnet>next‐ hop<address> ........ ..........................68 GlossaryofAcronyms.......................................................... 70 v BasicRouting 6.5R1v01 Vyatta QuickListofCommands Use this list to help you quickly locate commands. clearipprefix‐list ................................... ..............................................4 clearipv6prefix‐list .............. ................................. .................... ............5 ping<host> ................................. .................................................... 6 protocolsstaticinterface‐route<subnet>next‐hop‐interface<interface> .................................46 protocolsstaticinterface‐route6<subnet>next‐hop‐ interface<ethx> ......................... ...........48 protocolsstaticroute<subnet>blackhole ........ ...................................................50 protocolsstaticroute<subnet>next‐hop<address> ........................... ................ .......52 protocolsstaticroute6<subnet>blackhole..... ................................. ....................54 protocolsstaticroute6<subnet>next‐hop<address> ......... .............. ..........................56 protocolsstatictable<table>interface‐route<subnet>next‐hop‐interface<interface> ............. ........58 protocolsstatictable<table>interface‐route6<subnet>next‐hop‐interface<ethx>........................60 protocolsstatictable<table>route<subnet> blackhole .......................... .....................62 protocolsstatic table<table>route<subnet>next‐hop<address> .......................................64 protocolsstatictable<table>route6 <subnet>blackhole ..............................................66 protocolsstatic table<table>route6<subnet>next‐hop<address>...................... ................68 resetiproutecache... .................................................... ........................8 resetipv6routecache...................... ................................. ......................9 showipforwarding........... ................... ............ ............... ................... ..10 showiproute<ipv4net>longer‐prefixes ..... ... ............... ................... ..................13 showiproutecache .. ................... ........................ ................................14 showiprouteconnected .......... .. .. ................................. ..........................16 showiprouteforward ............ ......................... ............... .......................17 showiproutekernel ......... ............... ................... ..................................19 showiproutestatic...... ........................ ................................. ...............20 showip routesummary ............................................................. .............21 showiproutesupernets‐only.................... ............... ................... ................22 showiproutetable<table>.......................................................................23 showiproute....................... ................................. ...........................11 showipv6route<ipv6net>longer‐prefixes .................................. ........................25 showipv6routebgp...................... ............... ................... .....................26 showipv6routecache ...................... ................... . ................................. 27 showipv6routeconnected ............. ..........................................................28 vi BasicRouting 6.5R1v01 Vyatta showipv6routeforward ............ ................... ..........................................29 showipv6routekernel ..................... ................................. .....................30 showipv6routeripng ........................................... ............... ..................31 showipv6routestatic.............. ............... ...............................................32 showipv6routesummary ................................... .....................................33 showipv6route ........... ................................. .....................................24 showmonitoringprotocolsrib ............. .............. ............... ................... ........34 showtable...... ............... ................... .............................................35 traceroute<host>........ ............ ................................. ..........................36 vii BasicRouting 6.5R1v01 Vyatta ListofExamples Use this list to help you locate examples you’d like to look at or try. Example1‐1DisplayingIPforwardingstatus ........................ ................... ..............10 Example1‐2DisplayingroutesintheRIBandFIB.............................. .......................11 Example1‐3Displayingroutinginformationaboutaspecificaddress................... .................12 Example1‐4Displayingrouteswithlongerprefixes........................... ........................13 Example1‐5Listingroutesinthekernelroutecache .... .............. ................................14 Example1‐6Displayinginformationaboutarouteinthekernelroutecache....... .......................15 Example1‐7Displayingconnectedroutes....................... ................................. ...16 Example1‐8DisplayingroutesintheFIB........ ................................. ...................17 Example1‐9DisplayinginformationaboutarouteintheFIB....................................... ....18 Example1‐10 Displayingkernelroutes............. ................... .......... ....................19 Example1‐11 Displayingstaticroutes.......................... ....................................20 Example1‐12 Displayingasummaryofroutes........ ............... ................................21 Example1‐13 Displayingsupernet routes...........................................................22 Example1‐14 Displayingroutesinalternateroutingtable5................................. ...........23 Example1‐15 “showipv6routesummary”:DisplayingasummaryofIPv6routes..........................33 Example1‐ 16 Displayingtheroutingtable............... ................... ................. .. ......35 Example2‐1Creatingastaticroute................................ .................................39 Example2‐2Showingstaticroutesintheroutingtable ........ ................................. ........40 Example2‐3DetermineifforwardingisenabledonR1 ........................................ .........41 Example2 ‐4EnableforwardingonR1..................... ..........................................41 Example2‐5AddthedefaultrouteonR4 ......... ................ ...................................42 Example2‐6AddastaticrouteonR2...... ............... ................... .................... ...43 Example2‐7ConfirmconnectivitybetweenR2andR4 .................................... .............43 Example2‐8ConfirmconnectivitybetweenR2andR4viaR1 .......................... .................44 viii BasicRouting 6.5R1v01 Vyatta Preface This document presents information about forwarding and routing on the Vyatta system. This preface provides information about using this guide. The following topics are presented: • Intended Audience • Organization of This Guide • Document Conventions • Vyatta Publications IntendedAudience ix BasicRouting 6.5R1v01 Vyatta IntendedAudience This guide is intended for experienced system and network administrators. Depending on the functionality to be used, readers should have specific knowledge in the following areas: • Networking and data communications • TCP/IP protocols • General router configuration • Routing protocols • Network administration • Network security • IP services OrganizationofThisGuide This guide has the following aid to help you find the information you are looking for: • Quick List of Commands Use this list to help you quickly locate commands. • List of Examples Use this list to help you locate examples you’d like to try or look at. This guide has the following chapters: Chapter Description Page Chapter 1:ForwardingandRouting Thischapterdescribescommandsfor forwardingandbasicrouting. 1 Chapter 2:StaticRoutes Thischapterexplainshowtosetstaticroutes usingtheVyattasystem. 37 GlossaryofAcronyms 70 DocumentConventions x BasicRouting 6.5R1v01 Vyatta DocumentConventions This guide uses the following advisory paragraphs, as follows. NOTENotesprovideinformationyoumightneedtoavoidproblemsorconfigurationerrors. This document uses the following typographic conventions. WARNINGWarningsalertyoutosituationsthatmayposeathreattopersonalsafety. CAUTIONCautionsalertyoutosituationsthatmightcauseharmtoyoursystemordamageto equipment,orthatmayaffectservice. Monospace Examples, command-line output, and representations of configuration nodes. boldMonospace Your input: something you type at a command line. bold Commands, keywords, and file names, when mentioned inline. Objects in the user interface, such as tabs, buttons, screens, and panes. italics An argument or variable where you supply a value. <key> A key on your keyboard, such as <Enter>. Combinations of keys are joined by plus signs (“+”), as in <Ctrl>+c. [ key1 | key2] Enumerated options for completing a syntax. An example is [enable | disable]. num1–numN A inclusive range of numbers. An example is 1–65535, which means 1 through 65535, inclusive. arg1 argN A range of enumerated values. An example is eth0 eth3, which means eth0, eth1, eth2, or eth3. arg[ arg ] arg[,arg ] A value that can optionally represent a list of elements (a space-separated list and a comma-separated list, respectively). [...]... I ‐ ISIS, B ‐ BGP, > ‐ selected route, * ‐ FIB route S>* 12.34. 56. 0/24 [1/0] via 192. 168 .1.254, eth0 vyatta@ vyatta:~$ Basic Routing 6. 5R1 v01 Vyatta Chapter 1: Forwarding and Routing Forwarding and Routing Commands 24 show ipv6 route Displays IPv6 routes stored in the RIB and FIB Syntax show ipv6 route [ipv6 | ipv6net] Command Mode Operational mode Parameters ipv6 Optional Displays routing information for the specified IPv6 address ipv6net Optional... Displays routes stored in an alternate routing table show ipv6 route Displays IPv6 routes stored in the RIB and FIB show ipv6 route longer‐prefixes Displays IPv6 prefixes longer than a specified prefix show ipv6 route bgp Displays IPv6 BGP routes show ipv6 route cache Displays the kernel IPv6 route cache show ipv6 route connected Displays IPv6 connected routes Basic Routing 6. 5R1 v01 Vyatta Chapter 1: Forwarding and Routing ... Example 1‐4 Displaying routes with longer prefixes vyatta@ vyatta:~$ show ip route 10.192.128.0/24 longer‐prefixes Codes: K ‐ kernel route, C ‐ connected, S ‐ static, R ‐ RIP, O ‐ OSPF, I ‐ ISIS, B ‐ BGP, > ‐ selected route, * ‐ FIB route O>* 10.192.128.0/24 [110/11] via 10.1.0 .66 , eth0, 09: 36: 20 O>* 10.192.128.1/32 [110/11] via 10.1.0 .66 , eth0, 09: 36: 20 vyatta@ vyatta:~$ Basic Routing 6. 5R1 v01 Vyatta Chapter 1: Forwarding and Routing ... 172. 16. 234.0/25 dev eth1 proto kernel scope link src 172. 16. 234.23 192.94.202.0/24 via 172. 16. 234.27 dev eth1 proto zebra vyatta@ vyatta:~$ Example 1-9 shows how to display information from the FIB about route 10.1.0.0/24 Example 1‐9 Displaying information about a route in the FIB vyatta@ vyatta:~$ show ip route forward 10.1.0.0/24 10.1.0.0/24 dev eth0 proto kernel scope link src 10.1.0 .62 vyatta@ vyatta:~$ Basic Routing 6. 5R1 v01 Vyatta Chapter 1: Forwarding and Routing ... cache users 1 age 42sec mtu 1500 advmss 1 460 hoplimit 64 Basic Routing 6. 5R1 v01 Vyatta Chapter 1: Forwarding and Routing Forwarding and Routing Commands 15 10.0.0.30 from 10.1.0 .62 tos lowdelay via 10.1.0.1 dev eth0 cache users 2 age 0sec mtu 1500 advmss 1 460 hoplimit 64 multicast 224.0.0.5 from 10.1.0. 56 dev lo src 10.1.0 .62 cache users 1 used 8 age 8sec iif eth0 multicast 224.0.0.5 from 10.1.0 .66 dev lo src 10.1.0 .62 ... 10.192.130.0/24 via 10.1.0 .66 dev eth0 proto zebra metric 11 Basic Routing 6. 5R1 v01 Vyatta Chapter 1: Forwarding and Routing Forwarding and Routing Commands 18 10.192.131.0/24 via 10.1.0 .66 dev eth0 proto zebra metric 11 172. 16. 0.0/24 via 10.1.0.4 dev eth0 proto zebra metric 11 172. 16. 1.0/24 via 10.1.0.4 dev eth0 proto zebra metric 11 172. 16. 2.0/24 via 10.1.0.4 dev eth0 proto zebra metric 11 172. 16. 3.0/24 via 10.1.0.4 dev eth0 proto zebra metric 11... O>* 10.192.128.0/24 [110/11] via 10.1.0 .66 , eth0, 05:35:15 O>* 10.192.128.1/32 [110/11] via 10.1.0 .66 , eth0, 05:35:15 O>* 10.192.129.0/24 [110/11] via 10.1.0 .66 , eth0, 05:35:15 O>* 10.192.130.0/24 [110/11] via 10.1.0 .66 , eth0, 05:35:15 O>* 10.192.131.0/24 [110/11] via 10.1.0 .66 , eth0, 05:35:15 C>* 127.0.0.0/8 is directly connected, lo O>* 172. 16. 0.0/24 [110/11] via 10.1.0.4, eth0, 05:35:15 O>* 172. 16. 1.0/24 [110/11] via 10.1.0.4, eth0, 05:35:15... multicast 224.0.0.5 dev eth0 src 10.1.0 .62 cache users 1 used 8 age 5sec mtu 1500 advmss 1 460 hoplimit 64 69 .59.150.131 from 10.1.0 .62 via 10.1.0.1 dev eth0 cache users 1 used 1 age 47sec mtu 1500 advmss 1 460 hoplimit 64 local 10.1.0 .62 from 10.0.0.30 tos lowdelay dev lo src 10.1.0 .62 cache users 1 used 1 age 0sec iif eth0 vyatta@ vyatta:~$ Example 1 -6 shows how to display information... 10.1.0 .62 in the kernel route cache Example 1 6 Displaying information about a route in the kernel route cache vyatta@ vyatta:~$ show ip route cache 10.1.0 .62 local 10.1.0 .62 from 10.1.0.1 dev lo src 10.1.0 .62 cache users 1 used 3 age 9sec iif eth0 local 10.1.0 .62 from 69 .59.150.131 dev lo src 10.1.0 .62 cache users 1 used 7 age 102sec iif eth0 local 10.1.0 .62 from 10.0.0.30 tos lowdelay dev lo src 10.1.0 .62 ... route from the cache Basic Routing 6. 5R1 v01 Vyatta Chapter 1: Forwarding and Routing Forwarding and Routing Commands 9 reset ipv6 route cache Flushes the kernel IPv6 route cache Syntax reset ipv6 route cache [ipv6net] Command Mode Operational mode Parameters ipv6net Optional Flushes the specified route from the kernel IPv6 route cache Default Flushes the entire IPv6 route cache Usage Guidelines Use . VyattaSystem BasicRouting REFERENCEGUIDE ForwardingandRouting StaticRoutes COPYRIGHT Copyright©2005–2012Vyatta,Inc.Allrightsreserved. Vyattareservestherighttomakechangestosoftware,hardware,anddocumentationwithoutnotice.Forthemostrecentversionof documentation,visittheVyattawebsiteatvyatta.com. PROPRIETARYNOTICES VyattaisaregisteredtrademarkofVyatta,Inc. Hyper‐VisaregisteredtrademarkofMicrosoftCorporation. VMware,VMwareESX,andVMwareserveraretrademarksofVMware,Inc. XenServer,andXenCenteraretrademarksofCitrixSystems,Inc. Allothertrademarksarethepropertyoftheirrespectiveowners. RELEASEDATE:October2012 DOCUMENTREVISION. 6. 5R1 v01 RELEASEDWITH: 6. 5R1 PARTNO.A0‐0215‐10‐00 16 iii BasicRouting 6. 5R1 v01 Vyatta Contents QuickListofCommands........................................................ ForwardingandRoutingCommands 3 BasicRouting 6. 5R1 v01 Vyatta showipv6routeforward DisplaysIPv6routesstoredintheFIB. showipv6routekernel DisplaysIPv6kernelroutes. showipv6routeripng DisplaysIPv6RIPngroutes. showipv6routestatic. ForwardingandRoutingCommands 9 BasicRouting 6. 5R1 v01 Vyatta resetipv6routecache Flushes the kernel IPv6 route cache. Syntax reset ipv6 route cache [ipv6net] CommandMode Operational mode. Parameters Default Flushes the entire IPv6