Community discussions

MikroTik App
 
inquiery
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 63
Joined: Mon Oct 27, 2014 3:49 pm

Ping with VRF fail

Mon Jan 23, 2023 10:34 pm

Hello,

I am using an CCR with ROS v7.6 and I want to import some scripts from v6. Those scripts uses "routing-table" parameter from "ping" command, but it does not exists in v7, instead we need to use vrf.

I have created a bridge interface, with no ports, called "lo-vrf", and then I created an VRF
[xxx@edge] > /ip/vrf pr det
Flags: X - disabled; * - builtin 
 0    name="vrf-table" interfaces=lo-vrf 

 1  * name="main" interfaces=all 
And it does automatically creates a routing table:
[xxx@edge] > /routing/table/pr det
Flags: D - dynamic; X - disabled, I - invalid; U - used 
 0 D   name="main" fib 

 1 D   name="vrf-table" fib 
Then I have created a default route in that routing table, along with the default route from the main table:
[xxx@edge] > /ip/route/print det where dst-address=0.0.0.0/0
Flags: D - dynamic; X - disabled, I - inactive, A - active; c - connect, s - static, r - rip, b - bgp, o - ospf, d - dhcp, v - vpn, m - modem, y - copy; H - hw-offloaded; 
+ - ecmp 
   DAb   dst-address=0.0.0.0/0 routing-table=main pref-src=100.100.100.100 gateway=172.20.251.145 immediate-gw=172.20.251.145%vlan1 distance=20 scope=40 target-scope=10 
         suppress-hw-offload=no 

 0  As   dst-address=0.0.0.0/0 routing-table=vrf-table pref-src=100.100.100.100 gateway=172.20.251.145 immediate-gw=172.20.251.145%vlan1 distance=1 scope=30 
         target-scope=10 suppress-hw-offload=no 
When I use ping command without vrf, it works:
[xxx@edge] > ping 8.8.8.8 src-address=100.100.100.100
  SEQ HOST                                     SIZE TTL TIME       STATUS                                                                                                         
    0 8.8.8.8                                    56  57 19ms189us 
    1 8.8.8.8                                    56  57 19ms214us 
    2 8.8.8.8                                    56  57 19ms214us 
    3 8.8.8.8                                    56  57 18ms972us 
    4 8.8.8.8                                    56  57 24ms106us 
    sent=5 received=5 packet-loss=0% min-rtt=18ms972us avg-rtt=20ms139us max-rtt=24ms106us 
And if I use the vrf it fails with the error "could not make socket":
[xxx@edge] > ping 8.8.8.8 src-address=100.100.100.100 vrf=vrf-table
  SEQ HOST                                     SIZE TTL TIME       STATUS                                                                                                         
    0                                                              could not make socket                                                                                          
    1                                                              could not make socket                                                                                          
    2                                                              could not make socket                                                                                          
    3                                                              could not make socket                                                                                          
    4                                                              could not make socket                                                                                          
    sent=5 received=0 packet-loss=100% 
What am I doing wrong?

Who is online

Users browsing this forum: Bing [Bot] and 89 guests