Built-in Smartport Macros

The following describes the pair of built-in macros for each Smartport type. For each Smartport type there is a macro to configure the port and an anti macro to remove the configuration (no macro).

Macro code for the following Smartport types are provided:

desktop

[desktop]

#interface configuration, for increased network security and reliability when connecting a desktop device, such as a PC, to a switch port.

#macro description Desktop

#macro keywords $native_vlan $max_hosts

#

#macro key description: $native_vlan: The untag VLAN which will be configured on the port

# $max_hosts: The maximum number of allowed devices on the port

#Default Values are

#$native_vlan = Default VLAN

#$max_hosts = 10

#

#the port type cannot be detected automatically

#

#the default mode is trunk

smartport switchport trunk native vlan $native_vlan

#

port security max $max_hosts

port security mode max-addresses

port security discard trap 60

#

smartport storm-control broadcast level 10

smartport storm-control include-multicast

smartport storm-control broadcast enable

#

spanning-tree portfast

#

@

no_desktop

[no_desktop]

#macro description No Desktop

#

no smartport switchport trunk native vlan

smartport switchport trunk allowed vlan remove all

#

no port security

no port security mode

no port security max

#

no smartport storm-control broadcast enable

no smartport storm-control broadcast level

no smartport storm-control include-multicast

#

spanning-tree portfast auto

#

@

printer

[printer]

#macro description printer

#macro keywords $native_vlan

#

#macro key description: $native_vlan: The untag VLAN which will be configured on the port

#Default Values are

#$native_vlan = Default VLAN

#

#the port type cannot be detected automatically

#

switchport mode access

switchport access vlan $native_vlan

#

#single host

port security max 1

port security mode max-addresses

port security discard trap 60

#

smartport storm-control broadcast level 10

smartport storm-control include-multicast

smartport storm-control broadcast enable

#

spanning-tree portfast

#

@

no_printer

[no_printer]

#macro description No printer

#

no switchport access vlan

no switchport mode

#

no port security

no port security mode

#

no smartport storm-control broadcast enable

no smartport storm-control broadcast level

no smartport storm-control include-multicast

#

spanning-tree portfast auto

#

@

guest

[guest]

#macro description guest

#macro keywords $native_vlan

#

#macro key description: $native_vlan: The untag VLAN which will be configured on the port

#Default Values are

#$native_vlan = Default VLAN

#

#the port type cannot be detected automatically

#

switchport mode access

switchport access vlan $native_vlan

#

#single host

port security max 1

port security mode max-addresses

port security discard trap 60

#

smartport storm-control broadcast level 10

smartport storm-control include-multicast

smartport storm-control broadcast enable

#

spanning-tree portfast

#

@

no_guest]]

[no_guest]

#macro description No guest

#

no switchport access vlan

no switchport mode

#

no port security

no port security mode

#

no smartport storm-control broadcast enable

no smartport storm-control broadcast level

no smartport storm-control include-multicast

#

spanning-tree portfast auto

#

@

server

[server]

#macro description server

#macro keywords $native_vlan $max_hosts

#

#macro key description: $native_vlan: The untag VLAN which will be configured on the port

# $max_hosts: The maximum number of allowed devices on the port

#Default Values are

#$native_vlan = Default VLAN

#$max_hosts = 10

#

#the port type cannot be detected automatically

#

#the default mode is trunk

smartport switchport trunk native vlan $native_vlan

#

port security max $max_hosts

port security mode max-addresses

port security discard trap 60

#

smartport storm-control broadcast level 10

smartport storm-control broadcast enable

#

spanning-tree portfast

#

@

no_server

[no_server]

#macro description No server

#

no smartport switchport trunk native vlan

smartport switchport trunk allowed vlan remove all

#

no port security

no port security mode

no port security max

#

no smartport storm-control broadcast enable

no smartport storm-control broadcast level

#

spanning-tree portfast auto

#

@

host

[host]

#macro description host

#macro keywords $native_vlan $max_hosts

#

#macro key description: $native_vlan: The untag VLAN which will be configured on the port

# $max_hosts: The maximum number of allowed devices on the port

#Default Values are

#$native_vlan = Default VLAN

#$max_hosts = 10

#

#the port type cannot be detected automatically

#

#the default mode is trunk

smartport switchport trunk native vlan $native_vlan

#

port security max $max_hosts

port security mode max-addresses

port security discard trap 60

#

smartport storm-control broadcast level 10

smartport storm-control include-multicast

smartport storm-control broadcast enable

#

spanning-tree portfast

#

@

no_host

[no_host]

#macro description No host

#

no smartport switchport trunk native vlan

smartport switchport trunk allowed vlan remove all

#

no port security

no port security mode

no port security max

#

no smartport storm-control broadcast enable

no smartport storm-control broadcast level

no smartport storm-control include-multicast

#

spanning-tree portfast auto

#

@

ip_camera

[ip_camera]

#macro description ip_camera

#macro keywords $native_vlan

#

#macro key description: $native_vlan: The untag VLAN which will be configured on the port

#Default Values are

#$native_vlan = Default VLAN

#

switchport mode access

switchport access vlan $native_vlan

#

#single host

port security max 1

port security mode max-addresses

port security discard trap 60

#

smartport storm-control broadcast level 10

smartport storm-control include-multicast

smartport storm-control broadcast enable

#

spanning-tree portfast

#

@

no_ip_camera

[no_ip_camera]

#macro description No ip_camera

#

no switchport access vlan

no switchport mode

#

no port security

no port security mode

#

no smartport storm-control broadcast enable

no smartport storm-control broadcast level

no smartport storm-control include-multicast

#

spanning-tree portfast auto

#

@

ip_phone

[ip_phone]

#macro description ip_phone

#macro keywords $native_vlan $voice_vlan $max_hosts

#

#macro key description: $native_vlan: The untag VLAN which will be configured on the port

# $voice_vlan: The voice VLAN ID

# $max_hosts: The maximum number of allowed devices on the port

#Default Values are

#$native_vlan = Default VLAN

#$voice_vlan = 1

#$max_hosts = 10

#

#the default mode is trunk

smartport switchport trunk allowed vlan add $voice_vlan

smartport switchport trunk native vlan $native_vlan

#

port security max $max_hosts

port security mode max-addresses

port security discard trap 60

#

smartport storm-control broadcast level 10

smartport storm-control include-multicast

smartport storm-control broadcast enable

#

spanning-tree portfast

#

@

no_ip_phone

[no_ip_phone]

#macro description no ip_phone

#macro keywords $voice_vlan

#

#macro key description: $voice_vlan: The voice VLAN ID

#

#Default Values are

#$voice_vlan = 1

#

smartport switchport trunk allowed vlan remove $voice_vlan

no smartport switchport trunk native vlan

smartport switchport trunk allowed vlan remove all

#

no port security

no port security mode

no port security max

#

no smartport storm-control broadcast enable

no smartport storm-control broadcast level

no smartport storm-control include-multicast

#

spanning-tree portfast auto

#

@

ip_phone_desktop

[ip_phone_desktop]

#macro description ip_phone_desktop

#macro keywords $native_vlan $voice_vlan $max_hosts

#

#macro key description: $native_vlan: The untag VLAN which will be configured on the port

# $voice_vlan: The voice VLAN ID

# $max_hosts: The maximum number of allowed devices on the port

#Default Values are

#$native_vlan = Default VLAN

#$voice_vlan = 1

#$max_hosts = 10

#

#the default mode is trunk

smartport switchport trunk allowed vlan add $voice_vlan

smartport switchport trunk native vlan $native_vlan

#

port security max $max_hosts

port security mode max-addresses

port security discard trap 60

#

smartport storm-control broadcast level 10

smartport storm-control include-multicast

smartport storm-control broadcast enable

#

spanning-tree portfast

#

@

no_ip_phone_desktop

[no_ip_phone_desktop]

#macro description no ip_phone_desktop

#macro keywords $voice_vlan

#

#macro key description: $voice_vlan: The voice VLAN ID

#

#Default Values are

#$voice_vlan = 1

#

smartport switchport trunk allowed vlan remove $voice_vlan

no smartport switchport trunk native vlan

smartport switchport trunk allowed vlan remove all

#

no port security

no port security mode

no port security max

#

no smartport storm-control broadcast enable

no smartport storm-control broadcast level

no smartport storm-control include-multicast

#

spanning-tree portfast auto

#

@

switch

[switch]

#macro description switch

#macro keywords $native_vlan $voice_vlan

#

#macro key description: $native_vlan: The untag VLAN which will be configured on the port

# $voice_vlan: The voice VLAN ID

#Default Values are

#$native_vlan = Default VLAN

#$voice_vlan = 1

#

#the default mode is trunk

smartport switchport trunk allowed vlan add all

smartport switchport trunk native vlan $native_vlan

#

spanning-tree link-type point-to-point

#

@

no_switch

[no_switch]

#macro description No switch

#macro keywords $voice_vlan

#

#macro key description: $voice_vlan: The voice VLAN ID

#

no smartport switchport trunk native vlan

smartport switchport trunk allowed vlan remove all

#

no spanning-tree link-type

#

@

router

[router]

#macro description router

#macro keywords $native_vlan $voice_vlan

#

#macro key description: $native_vlan: The untag VLAN which will be configured on the port

# $voice_vlan: The voice VLAN ID

#

#Default Values are

#$native_vlan = Default VLAN

#$voice_vlan = 1

#

#the default mode is trunk

smartport switchport trunk allowed vlan add all

smartport switchport trunk native vlan $native_vlan

#

smartport storm-control broadcast level 10

smartport storm-control broadcast enable

#

spanning-tree link-type point-to-point

#

@

no_router

[no_router]

#macro description No router

#macro keywords $voice_vlan

#

#macro key description: $voice_vlan: The voice VLAN ID

#

no smartport switchport trunk native vlan

smartport switchport trunk allowed vlan remove all

#

no smartport storm-control broadcast enable

no smartport storm-control broadcast level

#

no spanning-tree link-type

#

@

ap

[ap]

#macro description ap

#macro keywords $native_vlan $voice_vlan

#

#macro key description: $native_vlan: The untag VLAN which will be configured on the port

# $voice_vlan: The voice VLAN ID

#

#Default Values are

#$native_vlan = Default VLAN

#$voice_vlan = 1

#

#the default mode is trunk

smartport switchport trunk allowed vlan add all

smartport switchport trunk native vlan $native_vlan

#

spanning-tree link-type point-to-point

#

@

no_ap

[no_ap]

#macro description No ap

#macro keywords $voice_vlan

#

#macro key description: $voice_vlan: The voice VLAN ID

#

no smartport switchport trunk native vlan

smartport switchport trunk allowed vlan remove all

#

no spanning-tree link-type

#

@