2016年12月30日 星期五

ARP

ARP address resolution protocol  protocol
找IP對應的MAC

  1. 廣播給所有host
  2. 接收到廣播訊息的會跟自己比對IP
  3. 比對一樣後會回MAC給發送
會存在ARP cache (用arp -a 看) 
當cahce存在時不會再跑arp,會直接去裡面抓需用arp -d  清掉後才會重抓

跨網段時會先找routing table
router裡面也有ARP TABLE

2016年12月28日 星期三

cco 帳號

登入去首頁
support → download software
support → bug search tool

觀念

SW端口
Switch(config)#switch mode access
Switch(config)#swich  access vlan 10 → 讓vlan10 可以通過該端口
一個vlan要耗掉一個端口,所以才用trunk來節省端口!!!



單臂路由
因為只用一條實體線路故稱單臂,將該條實體線路虛擬成多條線路來節省端口(同SW)
1.先將接口no sh開啟
2.子接口會配合VLAN ID設,方便辨識用 int f 0/1.10(子接口前面要與主接口相同)
3.先封裝 Router(config-subif)#encapsulation dot1Q 10 (10是VLAN ID)
4.設ip

L3 SW
no switchport → 當路由用 設IP
SVI (Switched Virtual Interface) 給 int vlan 10 設IP

ping不到可能是因為對面不知道怎麼回來

router 功能

  1. 阻擋廣播封包
  2. 劃分網路區域 (network segment)  → 廣播區域
  3. 繞送 (routing)

LAB 路由PING通練習

pc0 ip 192.168.10.1 mask 255.255.255.0 gw 192.168.10.254
pc1 ip 192.168.20.1 mask 255.255.255.0 gw 192.168.20.254

L2 switch 在vlan 1上設IP 管理用
vlan 1 預設關閉
switch 0設定
Switch(config)#int vlan 1
Switch(config-if)#no sh  將vlan1啟動
Switch(config-if)#ip address 192.168.10.10 255.255.255.0 設定管理ip telnet用
Switch(config)#ip default-gateway 192.168.10.254 設定sw的gw

L3 switch 設定 
先將int f0/1 設 no switchport 才可以輸入ip
Switch(config)#int f 0/1
Switch(config-if)#no switchport
Switch(config-if)#ip address 192.168.10.254 255.255.255.0

Switch(config)#int f 0/2
Switch(config-if)#no switchport
Switch(config-if)#ip address 192.168.20.254 255.255.255.0

Switch(config)#ip route 192.168.20.0 255.255.255.0 f0/2
Switch(config)#ip route 192.168.10.0 255.255.255.0 f0/1  (似乎不用 待確認)

Switch(config)#ip routing

2016年12月27日 星期二

LAB 練習

 L3 SW設定
開VLAN 10 20
Switch(config)#vlan 10
Switch(config)#vlan 20
Switch(config)#int vlan 10
Switch(config-if)#ip address 192.168.10.254 255.255.255.0    (設GW)
Switch(config)#int vlan 20
Switch(config-if)#ip address 192.168.20.254 255.255.255.0    (設GW)

Switch(config)#ip routing (啟動路由)
配置trunk 於f 0/1-2 用lacp
Switch(config)#int port-channel 1
Switch(config-if)#switchport trunk encapsulation dot1q  (封裝方式)
Switch(config-if)#switchport mode trunk
Switch(config)#int range f 0/1-2
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk
Switch(config-if-range)#channel-group 1 mode active

L2 SW 設定
開VLAN 10 20
Switch(config)#vlan 10
Switch(config)#vlan 20
Switch(config)#int f 0/23                                           (將f0/23 設vlan10)
Switch(config-if)#switchport mode access  
Switch(config-if)#switchport access vlan 10
Switch(config)#int f 0/24                                           (將f0/24 設vlan20)
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20
Switch(config)#ip default-gateway
配置trunk 於f 0/1-2 用lacp
Switch(config)#int range fastEthernet 0/1-2
Switch(config-if-range)#switchport mode trunk
Switch(config-if-range)#channel-group 1 mode active

Switch(config)#int vlan 50
Switch(config-if)#ip address 192.168.50.252
Switch(config-if)#standby 10 ip 192.168.50.254
Switch(config-if)#standby 10 priority 105

Switch(config-if)#standby 10 preempt

2016年12月26日 星期一

PVST+

PVST+ → Per-VLAN Spanning Tree Plus,增強型PVST
CISCO Catalys 交換機支持三種類型的Spanning-tree

  • PVST+ (預設)
  • MSTP
  • PVRST+

2016年12月23日 星期五

RSTP

RSTP (Rapid Spanning Tree Protocol) → IEEE 802.1W


它解决的就是STP技術中網络收斂速度不夠快的不足。基本工作原理與STP還是一樣,只是在端口角色和狀態定義上有所改變,以便加速網络收斂速度。


RSTP狀態只有三種
  • discarding(丟棄)  將blocking和listening合併(都不發送轉發及學習MAC)
  • learning
  • forwarding
RSTP有五種端口角色(STP只有三種, root port、designated port、disabled port)
  • root port
  • designated port
  • disabled port
  • alternate port  → root port 備援
  • backup port  → designated port 備援
  • edge port → access port (stp裡用portfast的地方)
交換機之間主動發送proposal(提議)和agreement(決策)


RSTP與STP都屬於Single Spanning Tree

inferior (次優)

Cisco的交換器預設使用的是Per-VLAN Spanning Tree Plus(PVST+), 即每個VLAN都有其各自的STP

(config)#spanning-tree mode rapid-pvst (啟動RPVST+)