{"id":28,"date":"2025-11-07T20:05:45","date_gmt":"2025-11-07T20:05:45","guid":{"rendered":"https:\/\/vyos.web.id\/?p=28"},"modified":"2025-11-07T20:05:45","modified_gmt":"2025-11-07T20:05:45","slug":"tips-and-tricks-for-vyos-1-2","status":"publish","type":"post","link":"https:\/\/vyos.web.id\/?p=28","title":{"rendered":"Tips and Tricks for VyOS 1.2"},"content":{"rendered":"\n<p>In VyOS, most routing operations are quite similar to other routers such as Juniper or Cisco. You can easily work with the routing table, BGP peers, and static routes using the commands below.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. Check BGP Peer Status<\/strong><\/h3>\n\n\n\n<p>To check the status of your BGP peers, use the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>show ip bgp summary\n<\/code><\/pre>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yudi@ALICIA:~$ show ip bgp summary\n\nIPv4 Unicast Summary:\nBGP router identifier 10.255.254.1, local AS number 55653 vrf-id 0\nBGP table version 31464515\nRIB entries 1381380, using 211 MiB of memory\nPeers 22, using 454 KiB of memory\n\nNeighbor        V         AS MsgRcvd MsgSent   TblVer  InQ OutQ  Up\/Down State\/PfxRcd\n10.0.0.34       4      65128  657883  651772        0    0    0 2d04h19m           31\n10.240.0.130    4      65126  329712  363591        0    0    0 3d02h57m           34\n10.240.0.166    4      65100  659306  652479        0    0    0 3d02h57m           25\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. Show Received Routes<\/strong><\/h3>\n\n\n\n<p>To view the routes received from a specific BGP peer:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>show ip bgp neighbors &#91;IP address] received-routes\n<\/code><\/pre>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>show ip bgp neighbors 202.52.15.134 received-routes\n<\/code><\/pre>\n\n\n\n<p>This command displays all routes learned from the specified peer.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3. Show Advertised Routes<\/strong><\/h3>\n\n\n\n<p>To check which routes are being advertised to a specific BGP neighbor:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>show ip bgp neighbors &#91;IP address] advertised-routes\n<\/code><\/pre>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>show ip bgp neighbors 202.52.15.134 advertised-routes\n<\/code><\/pre>\n\n\n\n<p>This command lists all prefixes that your router is announcing to that peer.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4. Find or Filter a Specific Network<\/strong><\/h3>\n\n\n\n<p>To search or filter a specific network in the routing table:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>show ip route | match &#91;network address]\n<\/code><\/pre>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yudi@ALICIA:~$ show ip route | match 103.202.52.0\/23\nB&gt;* 103.202.52.0\/23 &#91;200\/0] via 14.102.155.169, eth6.2050, 2d11h12m\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5. Show Static Routes<\/strong><\/h3>\n\n\n\n<p>To display all static routes configured on the router:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>show ip route static\n<\/code><\/pre>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yudi@ALICIA:~$ show ip route static\nS&gt;* 0.0.0.0\/0 &#91;1\/0] via 14.102.155.163, eth6.2048, 04w6d02h\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>6. Show BGP Routes<\/strong><\/h3>\n\n\n\n<p>To display routes that were learned via BGP:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>show ip route bgp\n<\/code><\/pre>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yudi@ALICIA:~$ show ip route bgp\nB&gt;* 1.0.0.0\/24 &#91;200\/0] via 14.102.155.169, eth6.2050, 02:50:45\nB&gt;* 1.0.4.0\/22 &#91;200\/0] via 14.102.155.169, eth6.2050, 03:14:04\nB&gt;* 1.0.5.0\/24 &#91;200\/0] via 14.102.155.169, eth6.2050, 03:14:04\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>7. Show Routing Table Summary<\/strong><\/h3>\n\n\n\n<p>To summarize all routing entries in the system:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>show ip route summary\n<\/code><\/pre>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Route Source         Routes               FIB  (vrf default)\nkernel               1                    1                    \nconnected            28                   28                   \nstatic               1                    1                    \nebgp                 1747                 1746                 \nibgp                 754427               754427               \n------\nTotals               756204               756203\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>8. Configure a Blackhole Static Route<\/strong><\/h3>\n\n\n\n<p>You can set a static route to <em>blackhole<\/em> for prefixes you originate to the Internet. This prevents routing loops and ensures proper route advertisement.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set protocols static route 125.160.9.0\/24 blackhole\ncommit\n<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In VyOS, most routing operations are quite similar to other routers such as Juniper or Cisco. You can easily work with the routing table, BGP peers, and static routes using the commands below. 1. Check BGP Peer Status To check the status of your BGP peers, use the following command: Example: 2. Show Received Routes [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-28","post","type-post","status-publish","format-standard","hentry","category-vyos"],"_links":{"self":[{"href":"https:\/\/vyos.web.id\/index.php?rest_route=\/wp\/v2\/posts\/28","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vyos.web.id\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vyos.web.id\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vyos.web.id\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vyos.web.id\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=28"}],"version-history":[{"count":1,"href":"https:\/\/vyos.web.id\/index.php?rest_route=\/wp\/v2\/posts\/28\/revisions"}],"predecessor-version":[{"id":29,"href":"https:\/\/vyos.web.id\/index.php?rest_route=\/wp\/v2\/posts\/28\/revisions\/29"}],"wp:attachment":[{"href":"https:\/\/vyos.web.id\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=28"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vyos.web.id\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=28"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vyos.web.id\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=28"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}