2013/06/18

Cisco 上課練習

20130618 上課內容,架構如下



目標:要設定左右兩台Router的介面卡,並且安裝WIC-1T,並設定好Serial Interface


先把左右兩台Router關機,將WIC-1T模組安裝到Router上,在將Router開機




進入到全域配置模式
Router>enable
Router#configure terminal



先設定左邊這台Router,第一張介面卡設定為 192.168.1.254/24,ON起來
Router(config)#interface fa0/0
Router(config-if)#ip address 192.168.1.254 255.255.255.0
Router(config-if)#no shutdown

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

Router(config-if)#exit

接著設定第二張介面卡,IP設定為192.168.2.254/24,ON起來

Router(config)#interface fa0/1
Router(config-if)#ip address 192.168.2.254 255.255.255.0
Router(config-if)#no shutdown

%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

Router(config-if)#exit

再來設定Serial的介面卡,Serial IP設定為210.10.10.1/24,將介面卡ON起來,Clock rate設定為64000
Router(config)#interface serial 0/3/0
Router(config-if)#ip address 210.10.10.1 255.255.255.0
Router(config-if)#no shutdown 

%LINK-5-CHANGED: Interface Serial0/3/0, changed state to down
Router(config-if)#clock rate 64000
Router(config-if)#exit


將左邊Router配置檔儲存起來

Router(config)#exit
Router#
%SYS-5-CONFIG_I: Configured from console by console

Router#copy running-config startup-config 
Destination filename [startup-config]? 
Building configuration...
[OK]
Router#


再來設定右邊這台Router,第一張介面卡設定為192.168.3.254/24,也要ON起來

Router(config)#interface fa0/0
Router(config-if)#ip address 192.168.3.254 255.255.255.0
Router(config-if)#no shutdown 

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

Router(config-if)#exit

第二張介面卡設定為192.168.4.254/24,也ON起來
Router(config)#interface fa0/1
Router(config-if)#ip address 192.168.4.254 255.255.255.0
Router(config-if)#no shutdown

%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

Router(config-if)#exit

Serial IP設定為210.10.10.2/24
Router(config)#interface serial 0/3/0
Router(config-if)#ip address 210.10.10.2 255.255.255.0
Router(config-if)#no shutdown

%LINK-5-CHANGED: Interface Serial0/3/0, changed state to up

Router(config-if)#exit


接著將右邊Router配置檔儲存起來
Router#copy running-config startup-config
Destination filename [startup-config]? 
Building configuration...
[OK]
Router#

再來設定每台Host的IP,依照該網段去分配,在此以最左邊電腦當作範例

點擊Host,選擇到Desktop/Configure IP Settings


初始IP設定為192.168.1.1,那Mask設定為255.255.255.0,Gateway就設定為Router介面的位置,192.168.1.254


現在可以達成192.168.1.1與192.168.2.1互相連結





但是沒辦法連結到192.168.3.1與192.168.4.1




反之192.168.3.1與192.168.4.1可以相互連結





但也沒辦法連結到192.168.1.1與192.168.2.1




還沒設定前Router Table,基本上只有192.168.1.0/24、192.168.2.0/24以及210.10.10.0/24的通道
Router#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

C    192.168.1.0/24 is directly connected, FastEthernet0/0
C    192.168.2.0/24 is directly connected, FastEthernet0/1
C    210.10.10.0/24 is directly connected, Serial0/3/0


讓左邊這台Router可以連接到192.168.3.0以及192.168.4.0的IP,並透過serial 0/3/0去連通吧!

Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#ip route 192.168.3.0 255.255.255.0 serial 0/3/0
Router(config)#ip route 192.168.4.0 255.255.255.0 serial 0/3/0
Router(config)#exit

再回來看看新的Router Table
Router#
%SYS-5-CONFIG_I: Configured from console by console

Router#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

C    192.168.1.0/24 is directly connected, FastEthernet0/0
C    192.168.2.0/24 is directly connected, FastEthernet0/1
S    192.168.3.0/24 is directly connected, Serial0/3/0
S    192.168.4.0/24 is directly connected, Serial0/3/0
C    210.10.10.0/24 is directly connected, Serial0/3/0
Router#



先觀察左邊這台Router設定前的Router Table

Router>enable
Router#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

C    192.168.3.0/24 is directly connected, FastEthernet0/0
C    192.168.4.0/24 is directly connected, FastEthernet0/1
C    210.10.10.0/24 is directly connected, Serial0/3/0

讓右邊這台Router可以連接到192.168.1.0以及192.168.2.0的IP,並透過serial 0/3/0去連通吧!
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#ip route 192.168.1.0 255.255.255.0 serial 0/3/0
Router(config)#ip route 192.168.2.0 255.255.255.0 serial 0/3/0
Router(config)#exit

再來觀察新增後的Router Table
Router#
%SYS-5-CONFIG_I: Configured from console by console

Router#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

S    192.168.1.0/24 is directly connected, Serial0/3/0
S    192.168.2.0/24 is directly connected, Serial0/3/0
C    192.168.3.0/24 is directly connected, FastEthernet0/0
C    192.168.4.0/24 is directly connected, FastEthernet0/1
C    210.10.10.0/24 is directly connected, Serial0/3/0
Router#


新增完Router Table就可以互相連結了

順道一提如果新增route table的出口是以介面卡當作出口,那優先權會比較重
例如: ip route 192.168.1.0 255.255.255.0 fa0/0 > ip route 192.168.1.0 255.255.255.0 210.10.10.2