Wstęp do IOS CISCO
IOS,czyli Internetwork Operating System został opracowany przez firmę Cisco. Służy do konfigurowania urządzeń sieciowych tej firmy, jak rutery czy przełączniki. Ten system operacyjny nie ma interfejsu graficznego, pracuje się w wierszu poleceń, czyli CLI.
Poniżej obrazek przedstawiający dostęp do CLI IOS w programie Packet tracer
Pomijamy dialog konfiguracji systemu.
--- System Configuration Dialog --- Continue with configuration dialog? [yes/no]: no
Ruter zgłasza się w trybie użytkownika, świadczy o tym znak >
Router>
Aby wejść do trybu uprzywilejowanego piszemy enable. Aby z niego wyjść piszemy disable
Router>enable Router#disable Router>enable Router#
Symbolem trybu uprzywilejowanego jest #
Sprawdźmy do jakich poleceń mamy dostęp w trybie użytkownika. Służy do tego ?
Router>? Exec commands: <1-99> Session number to resume connect Open a terminal connection disable Turn off privileged commands disconnect Disconnect an existing network connection enable Turn on privileged commands exit Exit from the EXEC logout Exit from the EXEC ping Send echo messages resume Resume an active network connection show Show running system information ssh Open a secure shell client connection telnet Open a telnet connection terminal Set terminal line parameters traceroute Trace route to destination
Jak widać w tym trybie nie zmienimy konfiguracji rutera, możemy głównie wyświetlać informacje.
W trybie uprzywilejowanym mamy dostęp do pełni poleceń.
Router#? Exec commands: <1-99> Session number to resume auto Exec level Automation clear Reset functions clock Manage the system clock configure Enter configuration mode connect Open a terminal connection copy Copy from one file to another debug Debugging functions (see also 'undebug') delete Delete a file dir List files on a filesystem disable Turn off privileged commands disconnect Disconnect an existing network connection enable Turn on privileged commands erase Erase a filesystem exit Exit from the EXEC logout Exit from the EXEC mkdir Create new directory more Display the contents of a file no Disable debugging informations ping Send echo messages reload Halt and perform a cold restart resume Resume an active network connection rmdir Remove existing directory send Send a message to other tty lines setup Run the SETUP command facility show Show running system information ssh Open a secure shell client connection telnet Open a telnet connection terminal Set terminal line parameters traceroute Trace route to destination undebug Disable debugging functions (see also 'debug') write Write running configuration to memory, network, or terminal
Helpa, czyli ? możemy używać także przy wprowadzaniu poleceń. Uzyskamy podpowiedź.
Router#cl? clear clock Router#clock? clock Router#clock ? set Set the time and date Router#clock set ? hh:mm:ss Current Time Router#clock set 18:42:00 ? <1-31> Day of the month MONTH Month of the year Router#clock set 18:42:00 12 ? MONTH Month of the year Router#clock set 18:42:00 december ? <1-31> Day of the month Router#clock set 18:42:00 december 10 ? <1993-2035> Year Router#clock set 18:42:00 december 10 2013 Router#
Jak widać znak ? stawiamy po spacji.
Przykładowa konfiguracja 1
Mamy dwie sieci LAN połączone ruterem. Poniżej pokazana będzie tylko konfiguracja rutera poprzez CLI. Zmienimy nazwę rutera na R1. Interfejsom rutera nadajemy pierwsze adresy z sieci, stacje otrzymują kolejne. Sieć 10.0.0.0 ma styczność z interfejsem FastEthernet0/0, natomiast sieć 192.168.0.0 z interfejsem FastEthernet1/0.
Router>enable Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname R1 R1(config)#interface FastEthernet0/0 R1(config-if)#ip address 10.0.0.1 255.0.0.0 R1(config-if)#no shutdown R1(config-if)# %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up R1(config-if)#exit R1(config)#interface FastEthernet1/0 R1(config-if)#ip address 192.168.0.1 255.255.255.0 R1(config-if)#no shutdown R1(config-if)# %LINK-5-CHANGED: Interface FastEthernet1/0, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to up
To tyle. Teraz wystarczy skonfigurować ustawienia sieciowe komputerów, w tym oczywiście bramy domyślne. Bramą jest interfejs sieciowy najbliższego rutera.
Poniżej rozpisuje nie wyjaśnione wcześniej polecenia.
Router#configure terminal
Przejście do konfiguracji rutera.
Router(config)#hostname R1
Zmiana nazwy na R1
R1(config)#interface FastEthernet0/0
Wejście do konfiguracji interfejsu FastEthernet0/0
R1(config-if)#ip address 10.0.0.1 255.0.0.0
Wpisanie adresu IP i maski sieciowej
R1(config-if)#no shutdown
Podniesienie interfejsu
R1(config-if)#exit
wyjście w górę
Przykładowa konfiguracja 2
Jak widać rutery połączone są poprzez złącza szeregowe. W obu przypadkach konfigurujemy interfejsy serial2/0
Konfiguracja 1 rutera
Router>enable Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#interface Serial2/0 Router(config-if)#ip address 172.16.1.1 255.255.0.0 Router(config-if)#clock rate 2000000 Router(config-if)#no shutdown
Analogicznie konfigurujemy 2 ruter