Start of Configuration
We connect the switch to the power supply.
We connect via a serial cable to the console port.
If there is no startup-config on the switch, the express setup wizard will start, which is better to disable and set everything under supervision.
On a clean switch, there are no passwords, so we can immediately access the configuration.
SWITCH>enable // switch to privileged mode SWITCH#configure terminal // switch to global configuration SWITCH(config)#hostname DS1-3750 // set the switch name
Time Setting
We set the correct time (for logs, etc.), we can do this manually
SWITCH#clock set 16:26:00 29 nov 2006 // set the time
or better automatically using an NTP server, for this configuration there are a number of commands, but the main one is this
SWITCH(config)#ntp server 10.0.0.50 // specify the NTP server
It is also necessary to set the correct time zone
SWITCH(config)#clock timezone GMT 1 // set the time zone
Time for Logs and Debug
By default, time data for logs and debug are displayed as the time since the switch started, which is usually not convenient, so it is better to switch the display to normal time and date.
SWITCH(config)#service timestamps debug datetime SWITCH(config)#service timestamps log datetime
Setting Passwords for Access to Privileged Mode
SWITCH(config)#enable secret c \t\t\t// password (here c) stored using MD5 hash
Setting the Switch IP Address (for VLAN 1)
For more convenient switch management, we will probably want to access it via IP (whether via web, telnet, or SSH), so it is necessary to set its IP address. In the optimal case, we create VLANs, set trunks and ports, and set the switch's IP address in the management VLAN. In the simpler case, where we do not use VLANs or for initial setup, we use the default VLAN 1, to which all ports belong.
SWITCH(config)#interface vlan 1 // switch to VLAN1 interface configuration SWITCH(config-if)#ip address 192.168.190.2 255.255.255.0 // set the IP address and subnet SWITCH(config-if)#no shutdown // enable the interface
If we want to access the switch from another subnet, we need to set the gateway address (so it knows where to send responses).
SWITCH(config)#ip default-gateway 192.168.190.1 // gateway address
Setting Access via Telnet, SSH, SNMP
Following the previous step, we enable access via telnet or SSH and, if we use it, set up SNMP. This was described in the article Cisco IOS 5 - communication with a switch.
Disabling Unused Services
From a security perspective, it is good to disable various services that run by default on the switch but we do not want to use. These services may include HTTP (web server), CDP (Cisco Discovery Protocol), VTP (VLAN Trunking Protocol), and others. More about services on the switch sometime next time.
Finally - Saving the Configuration
Again, I repeat an important warning. At the end of the configuration, it is necessary to save the changes made to the startup configuration so that we do not lose them upon restart.
SWITCH#copy running-config startup-config // save Destination filename [startup-config]? // prompt for name, press ENTER Building configuration... [OK]
Diky za super serial nejen o IOS. Ukladani konfigurace je mozen i prikazem wri
Mam jeden dotaz. Jak se vypina http sluzba v konfiguraci?
Diky a jen tak dal!!! :-)
respond to [1]Muf: Díky :-).
HTTP služba (tedy webové rozhraní na switchi) se dá vypnout pomocí příkazu
SWITCH(config)#no ip http server
jj, taky diky, obcas zabrousim ohledne nakyho infa o sitich, je to tu vyborne popsany, takze se to necha pekne pochopit! pohodovej den!
Ahoj
jsem uplna lama co se týč cisca... tvé články jsou perfektní! bez toho bych se nikam nedostal. no konfiguruji si svuj prvni catalyst 2950 a potřebuji se přihlašovat přes telnet nebo ssh. ale nějak se mě to nedaří. ssh jse mě nepodařilo nakonf, vůbec, tady to začalo protestovat )#ip ssh time-out 60 do te doby dobre. a přes telnet se to nastavilo bez zadrhele ale když to spustim přes putty, spustím a požádá mě to o heslo nastavil jsem si tam na zkoušku heslo jedno písmeno a to pismeno c. Proběhne přihlášení a svítí namě nově nastavený hostname.když zadam enable tak mě to napíše No password set! co mám špatně? dík moc
musíš nastavit heslo pro přihlášení ke konzoli viz kap.5
SWITCH(config)#line vty 0 1 // konfiguruji telnetová spojení s ID 0 až 1
SWITCH(config-line)#password c // heslo (zde c) pro přístup přes telnet
Cisco routery mají jinou správu vlan než Cisco switche? V configure terminal tam nelze zadat to "interface vlan"... Díky :)
<script>alert("ahoj samuraj")</script>
;-);-);-);-);-)Chlapi dikec, se spoluzakem jste nam timto clankem moc pomohli. takže 3IT z SPSSOU Pelhřimov vám moc děkuje.;-)