forked from zhenggen-xu/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CLI] Move hostname, mgmt interface/vrf config to hostcfgd (zhenggen-…
…xu#2) This PR depends on sonic-net/sonic-utilities#2173 #### Why I did it To be able to configure the management interface and hostname standalone by changing database config at runtime. From the CLI perspective fo view, the following behavior is the same. But now you have two ways of configuring it: CLI, directly through the database. #### How I did it Moved configuration part of the interface and hostname to "hostcfgd". #### How to verify it * Built an image * Flash it to the switch * Run CLI commands ``` # Set IP address: verify address is set on the iface sudo config interface ip add eth0 10.210.25.127/22 10.210.24.1 ip address show eth0 # 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 # link/ether 98:03:9b:a2:be:80 brd ff:ff:ff:ff:ff:ff # inet 10.210.25.127/22 brd 10.210.27.255 scope global eth0 # valid_lft forever preferred_lft forever # inet6 fe80::9a03:9bff:fea2:be80/64 scope link # valid_lft forever preferred_lft forever # Remove IP address: verify you received address form DHCP sudo config interface ip remove eth0 10.210.25.127/22 ip address show eth0 # 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 # link/ether 98:03:9b:a2:be:80 brd ff:ff:ff:ff:ff:ff # inet 10.210.25.127/22 brd 10.210.27.255 scope global eth0 # valid_lft forever preferred_lft forever # inet6 fe80::9a03:9bff:fea2:be80/64 scope link # valid_lft forever preferred_lft forever # Enable/disable mgmt VRF ip address show mgmt # Device "mgmt" does not exist. sudo config vrf add mgmt ip address show mgmt # 72: mgmt: <NOARP,MASTER,UP,LOWER_UP> mtu 65575 qdisc noqueue state UP group default qlen 1000 # link/ether fa:9b:ad:7b:1e:83 brd ff:ff:ff:ff:ff:ff sudo config vrf del mgmt ip address show mgmt # Device "mgmt" does not exist. # Setting the hostname admin@r-anaconda-27:~$ sudo config hostname bla # Login / Logout admin@bla:~$ ``` #### Description for the changelog * Moved management interface configuration to hostcfgd. * Moved management VRF configuration to hostcfgd. * Moved hostname configuration to hostcfgd. #### Submodules PR's : | Repo | PR title | State | | ----------------- | ----------------- | ----------------- | | sonic-utilities | [[CLI] Move hostname, mgmt interface/vrf config to hostcfgd](sonic-net/sonic-utilities#2173) | ![GitHub issue/pull request detail](https://img.shields.io/github/pulls/detail/state/Azure/sonic-utilities/2173) |
- Loading branch information
Showing
3 changed files
with
283 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.