Some Netgear Switching useful commands
- Last updated: Jun 27, 2024
Configuration
- Switch models: Netgear M4300-28G, GS724TPv2
Commands
- Privileged EXEC mode:
Switch> enable
- Global config mode:
Switch# configure
- Get firmware, serial number and hardware informations:
Switch# show version
- Change hostname:
Switch(config)# hostname Switch
- Save current config (M4300-28G):
Switch# copy system:running-config nvram:startup-config
- Save current config (GS724TPv2):
Switch# copy running-config startup-config
- Set switch ip:
Switch(config)# interface vlan1
ip address 192.168.1.100 /24
- Add ip gateway:
Switch(config)# ip default-gateway 192.168.1.254
- Set dns:
Switch(config)# ip name server 80.67.169.12
- Reboot:
Switch# reload
- Interface range:
Switch(config)# interface 1/0/1-1/0/4
- Set clibanner:
Switch(config)# set clibanner "Access to this device is prohibited
Enter a banner message. End with the '"' symbol.
"
Users
- Remove guest user:
Switch(config)# no username guest
- Set admin password:
Switch(config)# username admin password "password"
- Show users:
Switch# show users
SSH
- Generate rsa and dsa keys:
Switch(config)# crypto key generate rsa
Switch(config)# crypto key generate dsa
- Enable ssh service:
Switch(config)# ip ssh server enable
VLAN
M4300-28G
- Create a VLAN:
Switch(config)# vlan database
Switch(config-vlan)# vlan 20
Switch(config-vlan)# vlan name 20 ToIP
Switch(config-vlan)# vlan pvid 20
- Set the access VLAN to an interface:
Switch(config)# interface 1/0/1-1/0/4
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 20
- Configure the allowed VLANs to an interface (Trunk):
Switch(config)# interface 1/0/1
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk allowed vlan 1,20
GS724TPv2
- Create a VLAN:
Switch(config)# vlan 10
Switch(config-vlan)# name ToIP
- Set the access VLAN to an interface:
Switch(config)# interface g2
Switch(config-if)# switchport hybrid pvid 10
Switch(config-if)# switchport hybrid allowed vlan add 10 untagged
Switch(config-if)# switchport hybrid allowed vlan remove 1
- Configure the allowed VLANs to an interface (Trunk):
Switch(config)# interface g24
Switch(config-if)# hybrid allowed vlan add 10 tagged
STP
- Set RSTP:
Switch(config)# spanning-tree mode rstp
- Set bridge priority:
Switch(config)# spanning-tree mst priority 0 4096