Editing Port Trunked Vlans in Netbox

From Wikitech

Netbox is used to define what Vlans are 'trunked' on datacenter switch ports on which multiple Vlans are used.

This page gives a brief tutorial on how to modify which Vlans are trunked on a given port. This task is normally carried out by Netops, and generally is not something other SREs will need to complete. The exceptions may be for the small number of hosts which have multiple Vlans trunked to them.

WARNING: Core network changes of this type can cause site-wide problems if done in error. If such a change is required and there is any doubt about the correct actions to take please contact Netops directly for assistance.

In general it is a two-step process:

  1. Modify the vlan settings for the port in Netbox GUI.
  2. Run homer against the relevant switch to update the actual device configuration.

Edit Port in Netbox

1. Firstly navigate to the page for the port that needs to be modified in Netbox

2. Click on the yellow 'EDIT' button at the top of the page

3. The edit page will now be displayed

4. Scroll to the bottom to the '802.1Q Switching' section:

5. To REMOVE a Vlan simply click the 'x' beside it in the list beside 'Tagged VLANs', it will disappear from the list.

6. To ADD a Vlan click on the '+' symbol to the right of the 'Tagged VLANs' box.

7. A pop-up menu appears with a drop-down list of Vlans.

7. Search for the Vlan that needs to be added in the 'filter' box and click its name.

8. Finally click the solid blue SAVE button to finalize.

Run Homer Against Switch

To sync the Netbox change to the actual switch running configuration run Homer from a cumin host against it.

It should be run as a 'commit' operation, with a description of the change, for example:

homer "lsw1-e1-eqiad*" commit "Adding Vlan X to port Y on lsw1-e1-eqiad."

Homer will generate the full config for the switch, then show the user the diff from the current live config, and prompt to continue. Adding a Vlan to a trunk should look something like this, only modifying the 'members' list for the given port:

cmooney@cumin1001:~$ homer cloudsw1-e4-eqiad* commit "Add Vlan 1105 to et-0/0/54 on cloudsw1-e4-eqiad."
INFO:homer.devices:Initialized 54 devices
INFO:homer:Committing config for query cloudsw1-e4-eqiad* with message: Add Vlan 1105 to et-0/0/54 on cloudsw1-e4-eqiad.
INFO:homer:Gathering global Netbox data
INFO:homer.devices:Matched 1 device(s) for query 'cloudsw1-e4-eqiad*'
INFO:homer:Generating configuration for cloudsw1-e4-eqiad.mgmt.eqiad.wmnet
WARNING:homer.capirca:Netbox capirca.GetHosts script is > 3 days old.
Configuration diff for cloudsw1-e4-eqiad.mgmt.eqiad.wmnet:

[edit interfaces et-0/0/54 unit 0 family ethernet-switching vlan]
-       members [ cloud-xlink4-eqiad cloud-xlink8-eqiad ];
+       members [ cloud-instances2-b-eqiad cloud-xlink4-eqiad cloud-xlink8-eqiad ];

Type "yes" to commit, "no" to abort.
> no

If there is any doubt about the changes being made type 'no' and contact Netops for assistance. Otherwise type 'yes' and hit enter to complete the change. Please refer to the Homer documentation for more details.