Tips and Tricks for VyOS 1.2

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:

show ip bgp summary

Example:

yudi@ALICIA:~$ show ip bgp summary

IPv4 Unicast Summary:
BGP router identifier 10.255.254.1, local AS number 55653 vrf-id 0
BGP table version 31464515
RIB entries 1381380, using 211 MiB of memory
Peers 22, using 454 KiB of memory

Neighbor        V         AS MsgRcvd MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd
10.0.0.34       4      65128  657883  651772        0    0    0 2d04h19m           31
10.240.0.130    4      65126  329712  363591        0    0    0 3d02h57m           34
10.240.0.166    4      65100  659306  652479        0    0    0 3d02h57m           25

2. Show Received Routes

To view the routes received from a specific BGP peer:

show ip bgp neighbors [IP address] received-routes

Example:

show ip bgp neighbors 202.52.15.134 received-routes

This command displays all routes learned from the specified peer.


3. Show Advertised Routes

To check which routes are being advertised to a specific BGP neighbor:

show ip bgp neighbors [IP address] advertised-routes

Example:

show ip bgp neighbors 202.52.15.134 advertised-routes

This command lists all prefixes that your router is announcing to that peer.


4. Find or Filter a Specific Network

To search or filter a specific network in the routing table:

show ip route | match [network address]

Example:

yudi@ALICIA:~$ show ip route | match 103.202.52.0/23
B>* 103.202.52.0/23 [200/0] via 14.102.155.169, eth6.2050, 2d11h12m

5. Show Static Routes

To display all static routes configured on the router:

show ip route static

Example:

yudi@ALICIA:~$ show ip route static
S>* 0.0.0.0/0 [1/0] via 14.102.155.163, eth6.2048, 04w6d02h

6. Show BGP Routes

To display routes that were learned via BGP:

show ip route bgp

Example:

yudi@ALICIA:~$ show ip route bgp
B>* 1.0.0.0/24 [200/0] via 14.102.155.169, eth6.2050, 02:50:45
B>* 1.0.4.0/22 [200/0] via 14.102.155.169, eth6.2050, 03:14:04
B>* 1.0.5.0/24 [200/0] via 14.102.155.169, eth6.2050, 03:14:04

7. Show Routing Table Summary

To summarize all routing entries in the system:

show ip route summary

Example:

Route Source         Routes               FIB  (vrf default)
kernel               1                    1                    
connected            28                   28                   
static               1                    1                    
ebgp                 1747                 1746                 
ibgp                 754427               754427               
------
Totals               756204               756203

8. Configure a Blackhole Static Route

You can set a static route to blackhole for prefixes you originate to the Internet. This prevents routing loops and ensures proper route advertisement.

set protocols static route 125.160.9.0/24 blackhole
commit


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *