Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Cisco common commands

Shulou Source: shulou.com Published: 2022-06-01 10:32:36 10月02日 Update

Basic commands for new switch configuration

Switch

Switch# configure terminal

Switch (config) # hostname 9F-4 sets the switch name to 9F-4

9F-4 (config) # username test secret 1234.com sets the ciphertext password with the username test

9F-4 (config) # enable secret 1234.com sets the ciphertext password for enable

9F-4 (config) # vlan 800New vlan

9F-4 (config-vlan) # name Mgmt sets the vlan name

9F-4 (config) # vlan 200

9F-4 (config-vlan) # name User

9F-4 (config-vlan) # ip address 172.16.112.5 255.255.255.0 set IP for vlan 800s (manage IP)

9F-4 (config-vlan) # exit exits vlan editing

9F-4 (config) # interface gigabitEthernet 1-0-23

9F-4 (config-if) # switchport mode access configuration vlan

9F-4 (config-if) # switchport access vlan 200

9F-4 (config-if) # spanning-tree portfast setting Port Quick start

9F-4 (config-if) # description menjin port configuration name is menjin

9F-4 (config-if) # speed 10 sets the speed to 10m

9F-4 (config-if) # duplex full sets the port to full duplex

9F-4 (config-if) # switchport trunk native vlan 200 sets the port to native

9F-4 (config) # interface Port-channel11 sets the port channel11

9F-4 (config-if) # switchport mode trunk

9F-4 (config) # interface gigabitEthernet 1-0-28

9F-4 (config-if) # switchport mode trunk configure the port to be trunk

9F-4 (config-if) # channel-group 11 mode active application channel on the port, usually in a group of two

Core switch configuration

Configure the DHCP service

Ip dhcp pool User

Network 172.16.200.0255.255.255.0 DHCP address pool

Default-router 172.16.200.1 Gateway

Dns-server 202.96.209.133 8.8.8.8 DNS

Lease 8 lease (4 hours if 0 4)

Ip dhcp excluded-address 172.16.200.2 172.16.200.10 reserved address

Ip route 0.0.0.0 0.0.0.0 172.16.10.3 default route

Ip route 0.0.0.0 0.0.0.0 172.16.11.3 20 default route

This routing configuration means that 172.16.10.3 will automatically switch to 172.16.11.3 when it is cut off.

ACL configuration (reject policy, which needs to be applied in the in direction of vlan Guest)

Ip access-list extended Guest

Deny ip 10.112.250.0 0.0.0.255 10.112.10.0 0.0.0.255

IP anti-mask of deny ip Guest segment IP anti-mask of access segment

Deny ip 10.112.250.0 0.0.0.255 10.112.12.0 0.0.0.255

Deny ip 10.112.250.0 0.0.0.255 10.112.100.0 0.0.0.255

Deny ip 10.112.250.0 0.0.0.255 10.112.50.0 0.0.0.255

Deny ip 10.112.250.0 0.0.0.255 192.168.11.0 0.0.0.255

Deny ip 10.112.250.0 0.0.0.255 10.112.1.0 0.0.0.255

Permit ip any any

!

Interface Vlan600

Description Guest

Ip address 10.112.250.1 255.255.255.0

Ip access-group Guest in

Tags: Configuration port name route switch address ciphertext password application command foundation hour that is meaning new delivery direction core user lease policy Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Xiaomi MySQL Shulou Tech Info Redmi