ciscoswitchinitial-config
MDstable
NoteSnippetChecklistPlaybook
Configuration initiale switch Cisco
Setup complet : hostname, SSH, VTY, enable secret, NTP, SNMP, syslog, hardening
snippetbeginner 2025-05-14 2 min read
ciscoswitchinitial-configsshhardeningntpsnmpvtyios
Séquence de configuration initiale
Identité et sécurité de base
text
Variables
{{HOSTNAME}}
{{ENABLE_SECRET}}
{{ADMIN_SECRET}}
! -- Identitéhostname {{HOSTNAME}}enable secret {{ENABLE_SECRET}}service password-encryptionno ip domain-lookup! -- Compte local admin avec privilege 15username admin privilege 15 secret {{ADMIN_SECRET}}
SSH
text
Variables
{{DOMAIN_NAME}}
ip domain-name {{DOMAIN_NAME}}crypto key generate rsa modulus 2048ip ssh version 2ip ssh time-out 60ip ssh authentication-retries 3
VTY (lignes distantes)
text
line vty 0 15transport input sshlogin localexec-timeout 5 0logging synchronous
Console
text
line con 0exec-timeout 5 0logging synchronous
Banner
text
banner motd ^*******************************************************************************ACCES AUTORISE UNIQUEMENT AUX PERSONNES HABILITEESToute connexion non autorisee sera poursuivie.*******************************************************************************^
NTP
text
Variables
{{NTP_SERVER}}
clock timezone CET 1ntp server {{NTP_SERVER}}ntp update-calendar
Syslog
text
Variables
{{SYSLOG_SERVER}}
{{MGMT_VLAN}}
logging host {{SYSLOG_SERVER}}logging trap informationallogging source-interface vlan {{MGMT_VLAN}}
SNMP
text
Variables
{{COMMUNITY}}
{{LOCATION}}
{{CONTACT_EMAIL}}
snmp-server community {{COMMUNITY}} ROsnmp-server location {{LOCATION}}snmp-server contact {{CONTACT_EMAIL}}
VLAN de management et passerelle
text
Variables
{{MGMT_VLAN}}
{{MGMT_IP}}
{{MASK}}
{{GW_IP}}
interface vlan {{MGMT_VLAN}}description MANAGEMENTip address {{MGMT_IP}} {{MASK}}no shutdownip default-gateway {{GW_IP}}
Sauvegarde
text
write memory! ou équivalent :copy running-config startup-config
Checklist de configuration initiale
Checklist0/12
💡 Tip —
Toujours faire write memory avant de couper l'alimentation — la running-config est stockée en RAM et est volatile. Sans sauvegarde, toute la configuration est perdue au redémarrage.
OPS·BRAIN v1.027 notes · Networklocal