Changing the switchport default mode

By default all ports on an Arista switch are configured to be switch ports, as you would expect. If you are mostly dealing with routed ports, this behaviour may not be totally desirable. Starting in EOS-4.18.0, this behaviour is configurable e.g. we can have all interfaces in routed mode by default.

switch1...11:10:56(config)#show run int et 1-4
interface Ethernet1
interface Ethernet2
interface Ethernet3
interface Ethernet4
switch1...11:11:00(config)#show interface Et1-4 switchport | i Name|Switchport:
Name: Et1
Switchport: Enabled
Name: Et2
Switchport: Enabled
Name: Et3
Switchport: Enabled
Name: Et4
Switchport: Enabled

To change the default, simply issue the configuration command switchport default mode routed

As you can see, all interfaces are now in routed mode by default:

switch1...11:11:19(config)#switchport default mode routed
switch1...11:11:26(config)#show run int et 1-4
interface Ethernet1
   no switchport
interface Ethernet2
   no switchport
interface Ethernet3
   no switchport
interface Ethernet4
   no switchport
switch1...11:11:57(config-if-Et1)#show interface Et1-4 switchport | i Name|Switchport:
Name: Et1
Switchport: Disabled
Name: Et2
Switchport: Disabled
Name: Et3
Switchport: Disabled
Name: Et4
Switchport: Disabled

Of course, a side effect of this is that putting a port into access mode will result in extra config showing, since this is now different from the default:

switch1...11:11:29(config)#int et 1
switch1...11:12:30(config-if-Et1)#switchport mode access
switch1...11:12:34(config-if-Et1)#show a
interface Ethernet1
   switchport
switch1...11:12:37(config-if-Et1)#
switch1...11:12:42(config)#show interface Et1-4 switchport | i Name|Switchport:
Name: Et1
Switchport: Enabled
Name: Et2
Switchport: Disabled
Name: Et3
Switchport: Disabled
Name: Et4
Switchport: Disabled

To revert back to the usual behaviour, simply issue the command switchport default mode access

switch1...11:13:58(config)#switchport default mode access
switch1...11:14:07(config)#show run int et 1-4
interface Ethernet1
interface Ethernet2
interface Ethernet3
interface Ethernet4
switch1...11:14:28(config)#show interface Et1-4 switchport | i Name|Switchport:
Name: Et1
Switchport: Enabled
Name: Et2
Switchport: Enabled
Name: Et3
Switchport: Enabled
Name: Et4
Switchport: Enabled