Skip to content

Instantly share code, notes, and snippets.

@rwestphal
Last active November 16, 2018 01:37
Show Gist options
  • Save rwestphal/a185eb52c8016fd3ccfea763d040db04 to your computer and use it in GitHub Desktop.
Save rwestphal/a185eb52c8016fd3ccfea763d040db04 to your computer and use it in GitHub Desktop.
rt2-ripd# show yang operational-data /frr-ripd:ripd
{
"frr-ripd:ripd": {
"state": {
"neighbors": {
"neighbor": [
{
"address": "10.0.1.1",
"bad-packets-rcvd": 0,
"bad-routes-rcvd": 0
},
{
"address": "10.0.2.3",
"bad-packets-rcvd": 0,
"bad-routes-rcvd": 0
},
{
"address": "10.0.2.4",
"bad-packets-rcvd": 0,
"bad-routes-rcvd": 0
},
{
"address": "10.0.3.3",
"bad-packets-rcvd": 0,
"bad-routes-rcvd": 0
}
]
},
"routes": {
"route": [
{
"prefix": "1.1.1.1/32",
"next-hop": "10.0.1.1",
"metric": 2
},
{
"prefix": "2.2.2.2/32",
"interface": "rt2-lo1",
"metric": 1
},
{
"prefix": "3.3.3.3/32",
"next-hop": "10.0.2.3",
"metric": 2
},
{
"prefix": "4.4.4.4/32",
"next-hop": "10.0.2.4",
"metric": 2
},
{
"prefix": "10.0.1.0/24",
"interface": "rt2-eth0",
"metric": 1
},
{
"prefix": "10.0.2.0/24",
"interface": "rt2-eth1",
"metric": 1
},
{
"prefix": "10.0.3.0/24",
"interface": "rt2-eth2",
"metric": 1
}
]
}
}
}
}
rt2-ripd#
rt2-ripd# show yang operational-data /frr-ripd:ripd/state/routes
{
"frr-ripd:ripd": {
"state": {
"routes": {
"route": [
{
"prefix": "1.1.1.1/32",
"next-hop": "10.0.1.1",
"metric": 2
},
{
"prefix": "2.2.2.2/32",
"interface": "rt2-lo1",
"metric": 1
},
{
"prefix": "3.3.3.3/32",
"next-hop": "10.0.2.3",
"metric": 2
},
{
"prefix": "4.4.4.4/32",
"next-hop": "10.0.2.4",
"metric": 2
},
{
"prefix": "10.0.1.0/24",
"interface": "rt2-eth0",
"metric": 1
},
{
"prefix": "10.0.2.0/24",
"interface": "rt2-eth1",
"metric": 1
},
{
"prefix": "10.0.3.0/24",
"interface": "rt2-eth2",
"metric": 1
}
]
}
}
}
}
rt2-ripd#
rt2-ripd# show yang operational-data /frr-ripd:ripd/state/routes/route[prefix='2.2.2.2/32']
{
"frr-ripd:ripd": {
"state": {
"routes": {
"route": [
{
"prefix": "2.2.2.2/32",
"interface": "rt2-lo1",
"metric": 1
}
]
}
}
}
}
rt2-ripd#
rt2-ripd# show yang operational-data /frr-ripd:ripd format xml
<ripd xmlns="http://frrouting.org/yang/ripd">
<state>
<neighbors>
<neighbor>
<address>10.0.1.1</address>
<bad-packets-rcvd>0</bad-packets-rcvd>
<bad-routes-rcvd>0</bad-routes-rcvd>
</neighbor>
<neighbor>
<address>10.0.2.3</address>
<bad-packets-rcvd>0</bad-packets-rcvd>
<bad-routes-rcvd>0</bad-routes-rcvd>
</neighbor>
<neighbor>
<address>10.0.2.4</address>
<bad-packets-rcvd>0</bad-packets-rcvd>
<bad-routes-rcvd>0</bad-routes-rcvd>
</neighbor>
<neighbor>
<address>10.0.3.3</address>
<bad-packets-rcvd>0</bad-packets-rcvd>
<bad-routes-rcvd>0</bad-routes-rcvd>
</neighbor>
</neighbors>
<routes>
<route>
<prefix>1.1.1.1/32</prefix>
<next-hop>10.0.1.1</next-hop>
<metric>2</metric>
</route>
<route>
<prefix>2.2.2.2/32</prefix>
<interface>rt2-lo1</interface>
<metric>1</metric>
</route>
<route>
<prefix>3.3.3.3/32</prefix>
<next-hop>10.0.2.3</next-hop>
<metric>2</metric>
</route>
<route>
<prefix>4.4.4.4/32</prefix>
<next-hop>10.0.2.4</next-hop>
<metric>2</metric>
</route>
<route>
<prefix>10.0.1.0/24</prefix>
<interface>rt2-eth0</interface>
<metric>1</metric>
</route>
<route>
<prefix>10.0.2.0/24</prefix>
<interface>rt2-eth1</interface>
<metric>1</metric>
</route>
<route>
<prefix>10.0.3.0/24</prefix>
<interface>rt2-eth2</interface>
<metric>1</metric>
</route>
</routes>
</state>
</ripd>
rt2-ripd#
rt2-ripd# show yang operational-data /frr-ripd:ripd translate ietf
{
"ietf-routing:routing": {
"control-plane-protocols": {
"control-plane-protocol": [
{
"type": "ietf-rip:ripv2",
"name": "main",
"ietf-rip:rip": {
"ipv4": {
"neighbors": {
"neighbor": [
{
"ipv4-address": "10.0.1.1",
"bad-packets-rcvd": 0,
"bad-routes-rcvd": 0
},
{
"ipv4-address": "10.0.2.3",
"bad-packets-rcvd": 0,
"bad-routes-rcvd": 0
},
{
"ipv4-address": "10.0.2.4",
"bad-packets-rcvd": 0,
"bad-routes-rcvd": 0
},
{
"ipv4-address": "10.0.3.3",
"bad-packets-rcvd": 0,
"bad-routes-rcvd": 0
}
]
},
"routes": {
"route": [
{
"ipv4-prefix": "1.1.1.1/32",
"next-hop": "10.0.1.1",
"metric": 2
},
{
"ipv4-prefix": "2.2.2.2/32",
"interface": "rt2-lo1",
"metric": 1
},
{
"ipv4-prefix": "3.3.3.3/32",
"next-hop": "10.0.2.3",
"metric": 2
},
{
"ipv4-prefix": "4.4.4.4/32",
"next-hop": "10.0.2.4",
"metric": 2
},
{
"ipv4-prefix": "10.0.1.0/24",
"interface": "rt2-eth0",
"metric": 1
},
{
"ipv4-prefix": "10.0.2.0/24",
"interface": "rt2-eth1",
"metric": 1
},
{
"ipv4-prefix": "10.0.3.0/24",
"interface": "rt2-eth2",
"metric": 1
}
]
}
}
}
}
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment