switchport parameters flip the port's mode, and a port can hold a static address and a DHCP client at once #1285
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge#1285
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A command that is about a VLAN parameter also changes the port's mode, and a port with a static address
accepts a DHCP client on top of it. Both are one command changing something the operator did not ask about.
1.
switchport trunk native vlanon an access port makes it a trunkMeasured on a plain access port, before:
vlan.modewasaccess; after:trunk. Same forswitchport trunk allowed vlan 10,20and, in the other direction,switchport access vlan 30on a trunkport (which turned the trunk into an access port).
VLAN 20 — a configuration change nobody asked for, in a column nobody typed into;
accepts: the parameter is stored and the mode is left alone;
show running-configand never came back on restore.2. A port holds a static address and a DHCP client at once
state afterwards:
{ ip: "10.0.0.1", dhcp: true }. Three surfaces then disagree about one port:routeTo()will route for it;show ip interface briefreports MethodDHCPbeside that address;show running-configprints onlyip address 10.0.0.1 255.255.255.0, so restoring the backup loses theDHCP intent.
The reverse direction already cleared the flag, but silently — the operator could not tell which method was
in force — and
no ip addressanswered "IP address removed from Gi0/0" whether or not there was an address,and whether or not the port was a DHCP client.
3. Found while testing #2: the backup bakes in a leased address
A DHCP host that has leased
10.0.0.100printedRestored on a different network, that host claims a stale address and never asks for a new one. A backup has to
describe what was configured, not what the last exchange produced.
What "done" looks like
switchport trunk native vlan,switchport trunk allowed vlanandswitchport access vlanstore theirvalue and never change the mode; only
switchport modechanges the mode;it —
Trunk native VLAN 20 on Fa0/1 (stored; the port is in access mode - set "switchport mode trunk" to use it)— and says nothing when the value is used immediately;show running-configin either mode, and a backup replays byte-identically;show vlanand the data plane still report only what the port carries, not what it is staged for;Interface Gi0/0 set to DHCP (static address 10.0.0.1/24 removed)/IP address set on Gi0/0: 10.0.0.1/24 (DHCP client removed);no ip addressnames what it removed, or refuses when there is nothing to remove;show running-configprintsip address dhcpfor a leased host, never the leased address;