Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ping: T2762: Ability to use correct VRF context for ping #1175

Closed
wants to merge 1 commit into from

Conversation

sever-sever
Copy link
Member

Change Summary

When we connect to VyOS node via ssh in VRF, we expected by
default to send pings from this "VRF" context and not from
"default" vrf context
Add function that detected in which VRF context service "sshd"
Send pings from the correct "VRF" context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Component(s) name

ping

Proposed changes

How to test

Connect to ssh that configured in vrf foo
Ping from this vrf by default (expected ping without word vrf foo):

vyos@r11-roll:~$ show ip route vrf foo

VRF foo:
S>* 0.0.0.0/0 [1/0] via 192.168.122.1, eth0, weight 1, 03:24:49
K * 0.0.0.0/0 [255/8192] unreachable (ICMP unreachable), 03:24:56
C>* 192.168.122.0/24 is directly connected, eth0, 03:24:55

vyos@r11-roll:~$ who
vyos     pts/0        2022-01-17 22:19 (192.168.122.1)

### DEBUG MODE
vyos@r11-roll:~$ ping 192.168.122.1

DEBUG: sudo ip vrf exec foo /bin/ping 192.168.122.1

PING 192.168.122.1 (192.168.122.1) 56(84) bytes of data.
64 bytes from 192.168.122.1: icmp_seq=1 ttl=64 time=0.114 ms
64 bytes from 192.168.122.1: icmp_seq=2 ttl=64 time=0.182 ms

vyos@r11-roll:~$ ping 1.1.1.1

DEBUG: sudo ip vrf exec foo /bin/ping 1.1.1.1

PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
64 bytes from 1.1.1.1: icmp_seq=1 ttl=57 time=38.7 ms
64 bytes from 1.1.1.1: icmp_seq=2 ttl=57 time=38.9 ms


vyos@r11-roll:~$ ping 203.0.113.1 vrf default

DEBUG: sudo ip vrf exec default /bin/ping 203.0.113.1

PING 203.0.113.1 (203.0.113.1) 56(84) bytes of data.
64 bytes from 203.0.113.1: icmp_seq=1 ttl=64 time=0.058 ms


Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

When we connect to VyOS node via ssh in VRF, we expected by
default to send pings from this "VRF" context and not from
"default" vrf context
Add function that detected in which VRF context service "sshd"
Send pings from the correct "VRF" context
@c-po
Copy link
Member

c-po commented Jan 18, 2022

This is in contrast to every NOS I know. Not specifying anvrf always places you in default VRF. In my opinion this will add more harm then good.

A better thing would be to fix tab completion tomshowma list of all available VRFs for ping.

Also it will break existing automation scripts/API as now ping might run under a different VRF by default.

@sever-sever
Copy link
Member Author

I don’t have much experience with vrf. I thought that when you shh to vrf context, all commands (include pings) are executed by default from context vrf.
Everything is much more complicated than I thought.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants