10 30 23 configure a switch port security configs

Опубликовано: 05 Сентябрь 2026
на канале: Richard Mehok
21
0

hostname lab_switch

enable secret enblepassword

service password-encryption

interface Vlan1
ip address 192.168.1.2 255.255.255.0
no shutdown

ip default-gateway 192.168.1.1

logging 192.168.1.254

username admin password username

ip domain-name cisco.com

crypto key generate rsa

ip ssh version 2
ip ssh authentication-retries 2
ip ssh time-out 60

line con 0
logging synchronous
password linecon
login

line vty 0 4
login local
transport input ssh
banner motd #Warning#

crypto key generate rsa
logging host 192.168.1.254

[must use 768 1024 2048 bit encryption]
____________________________________________________

switch

int fas0/1
switchport mode access
switchport port-security
switchport port-security mac-address 0007.ECE0.D657
switchport port-security violation shutdown

int fas0/2
switchport mode access
switchport port-security
switchport port-security mac-address 0001.647C.697E
switchport port-security violation protect

int fas0/3
switchport mode access
switchport port-security
switchport port-security mac-address 0090.0CD8.BDC5
switchport port-security violation restrict

int fas0/4
switchport mode access
switchport port-security
switchport port-security mac-address 00D0.BA37.1D2D
switchport port-security violation restrict


Switch#sh port-security int
Switch#sh port-security interface fas0/1
Port Security : Disabled
Port Status : Secure-down
Violation Mode : Shutdown
Aging Time : 0 mins
Aging Type : Absolute
SecureStatic Address Aging : Disabled
Maximum MAC Addresses : 1
Total MAC Addresses : 0
Configured MAC Addresses : 0
Sticky MAC Addresses : 0
Last Source Address:Vlan : 0000.0000.0000:0
Security Violation Count : 0
____________________________________________________________________

Router Config

enable
config t

hostname Router1

enable secret cyber

service password-encryption

int fa0/0
ip address 192.168.1.1 255.255.255.0
no shutdown
description LAN

username admin password username
ip domain-name cisco.com

username admin password username
ip domain-name cisco.com

ip ssh version 2
ip ssh authentication-retries 2
ip ssh time-out 60

line con 0
logging synchronous
password linecon
login

line vty 0 4
login local
transport input ssh

banner motd #Warning#

crypto key generate rsa
logging host 192.168.1.254

[must use 768 1024 2048 bit encryption]