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

interfaces: T4331: Fix assign link-local static IPv6 addr to vrf #1270

Merged
merged 1 commit into from
Apr 5, 2022

Conversation

sever-sever
Copy link
Member

Change Summary

Set address after vrf
Fix assign link-local static address to vrf

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

interfaces

Proposed changes

How to test

If we have link-local static address fe80::5200:ff:fe55:222/64 and vrf, for example:

set interfaces ethernet eth2 address 'fe80::5200:ff:fe55:222/64'
set interfaces ethernet eth2 vrf 'foo'

This IPv6 address was assign before vrf, as result after
attaching the interface to vrf we lose this static linklocal
address

DEBUG/IFCONFIG cmd 'ip addr add fe80::5200:ff:fe55:222/64 dev eth2'
DEBUG/IFCONFIG cmd 'ip link set dev eth2 master foo'
DEBUG/IFCONFIG cmd 'ip addr add fe80::5208:ff:fe13:2/64 dev eth2'

Before fix IPv6 address fe80::5200:ff:fe55:222/64 not in the routing table:

set interfaces ethernet eth2 address 'fe80::5200:ff:fe55:222/64'
set interfaces ethernet eth2 address '192.0.2.5/32'
set interfaces ethernet eth2 address '2002:2::2/120'
et interfaces ethernet eth2 vrf 'foo'
set vrf name foo table '120'

4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master foo state UP group default qlen 1000
    link/ether 50:08:00:13:00:02 brd ff:ff:ff:ff:ff:ff
    inet 192.0.2.5/32 scope global eth2
       valid_lft forever preferred_lft forever
    inet6 2002:2::2/120 scope global 
       valid_lft forever preferred_lft forever
    inet6 fe80::5208:ff:fe13:2/64 scope link 
       valid_lft forever preferred_lft forever

After fix IPv6 address fe80::5200:ff:fe55:222/64 in the routing table

4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master foo state UP group default qlen 1000
    link/ether 50:08:00:13:00:02 brd ff:ff:ff:ff:ff:ff
    inet 192.0.2.5/32 scope global eth2
       valid_lft forever preferred_lft forever
    inet6 2002:2::2/120 scope global 
       valid_lft forever preferred_lft forever
    inet6 fe80::5208:ff:fe13:2/64 scope link 
       valid_lft forever preferred_lft forever
    inet6 fe80::5200:ff:fe55:222/64 scope link 
       valid_lft forever preferred_lft forever

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

If we have link-local static address and vrf, for example:
set interfaces ethernet eth2 address 'fe80::5200:ff:fe55:222/64'
set interfaces ethernet eth2 vrf 'foo'

This IPv6 address was assigned before vrf, as result after
attaching the intreface to vrf we lose this static linklocal
address

DEBUG/IFCONFIG cmd 'ip addr add fe80::5200:ff:fe55:222/64 dev eth2'
DEBUG/IFCONFIG cmd 'ip link set dev eth2 master foo'
DEBUG/IFCONFIG cmd 'ip addr add fe80::5208:ff:fe13:2/64 dev eth2'

This commit fixes this, the address is assigned after vrf assign
@c-po c-po merged commit be57ae3 into vyos:current Apr 5, 2022
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