利用二層埠安全防止兩個三層交換機長距離光纖線路被亂接測試
一.概述:
在論壇上看到有人想問通過什麼方式來防止長距離的光纖線路被竊聽,或連到其它非法交換機上,如是相同通過埠安全來實現防止亂接,於是登入機架進行測試,將測試結果記錄下來。
—-光纖線路,如果中間沒有被惡意接入其他裝置,應該很難竊聽,因此覺得防竊聽可以從防亂接方向入手。
二.基本思路:
A.假定交換機為三層交換機
B.如果兩個交換機用三層口相連,並繫結對端IP所對應的mac,雖然可以防止接入三層裝置,但是無法防止中間串接二層裝置進行竊聽。
C.通過主機之間的ipsec來加密流量,除非接線兩端為路由器,否則兩端連線交換機的主機太多的話,每臺主機去配置IPsec不大可行。
—–高階的交換機沒有玩過,一般普通的三層交換機貌似無法配置ipsec vpn
D.資料加密雖然是防竊聽的最好方式,但是目前這種情況,貌似加密不容易實現
E.通過二層的安全來防止亂接:
—交換機相連的口採用access口,並且兩端都配置VLAN的svi
—每個交換機保證用於互聯的vlan只有一個互聯介面
—三層交換機要開啟路由轉發,兩個三層交換機互指路由(靜態或預設),來實現交換機兩邊的PC互訪
—配置互聯埠的埠安全,只允許學習到2個mac,這樣只有中間線路沒有其他二層裝置,當接入其他二層裝置時,埠就會down,防止被監聽
—本實驗只是驗證可行性,實際工作如果可能的話,還是建議用路由器互聯,並配置ipsec。
三.測試拓撲:
四.基本配置:
A.R4:
interface FastEthernet0/0
ip address 20.1.1.4 255.255.255.0
ip address 20.1.1.4 255.255.255.0
no shut
no ip routing
ip default-gateway 20.1.1.1
B.SW1:
ip routing
interface FastEthernet0/4
switchport access vlan 20
switchport mode access
switchport access vlan 20
switchport mode access
interface FastEthernet0/20
switchport access vlan 10
switchport mode access
switchport port-security maximum 2
switchport port-security
switchport port-security mac-address sticky
switchport access vlan 10
switchport mode access
switchport port-security maximum 2
switchport port-security
switchport port-security mac-address sticky
interface Vlan10
ip address 10.1.1.1 255.255.255.252
interface Vlan20
ip address 20.1.1.1 255.255.255.0
ip route 0.0.0.0 0.0.0.0 10.1.1.2
ip address 10.1.1.1 255.255.255.252
interface Vlan20
ip address 20.1.1.1 255.255.255.0
ip route 0.0.0.0 0.0.0.0 10.1.1.2
C.SW2:
ip routing
interface FastEthernet0/5
switchport access vlan 30
switchport mode access
switchport access vlan 30
switchport mode access
interface FastEthernet0/20
switchport access vlan 10
switchport mode access
switchport port-security maximum 2
switchport port-security
switchport port-security mac-address sticky
switchport access vlan 10
switchport mode access
switchport port-security maximum 2
switchport port-security
switchport port-security mac-address sticky
interface Vlan30
ip address 30.1.1.1 255.255.255.0
interface Vlan100
ip address 10.1.1.2 255.255.255.252
ip route 0.0.0.0 0.0.0.0 10.1.1.1
interface Vlan100
ip address 10.1.1.2 255.255.255.252
ip route 0.0.0.0 0.0.0.0 10.1.1.1
D.R5:
interface FastEthernet0/1
ip address 30.1.1.5 255.255.255.0
ip address 30.1.1.5 255.255.255.0
no shut
no ip routing
ip default-gateway 30.1.1.1
五.驗證:
R4#ping 30.1.1.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 30.1.1.5, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 30.1.1.5, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms
R4#
R5#ping 20.1.1.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 20.1.1.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
R5#
sw1#show running-config interface f0/20
Building configuration…
Current configuration : 336 bytes
!
interface FastEthernet0/20
switchport access vlan 10
switchport mode access
switchport port-security maximum 2
switchport port-security
switchport port-security mac-address sticky
switchport port-security mac-address sticky 0014.a80a.f716 vlan access
switchport port-security mac-address sticky 0014.a80a.f741 vlan access
end
Building configuration…
Current configuration : 336 bytes
!
interface FastEthernet0/20
switchport access vlan 10
switchport mode access
switchport port-security maximum 2
switchport port-security
switchport port-security mac-address sticky
switchport port-security mac-address sticky 0014.a80a.f716 vlan access
switchport port-security mac-address sticky 0014.a80a.f741 vlan access
end
sw2#show int f0/20 | in Hardware
Hardware is Fast Ethernet, address is 0014.a80a.f716 (bia 0014.a80a.f716)
Hardware is Fast Ethernet, address is 0014.a80a.f716 (bia 0014.a80a.f716)
sw2#show int vlan 10 | in Hardware
Hardware is EtherSVI, address is 0014.a80a.f741 (bia 0014.a80a.f741)
Hardware is EtherSVI, address is 0014.a80a.f741 (bia 0014.a80a.f741)
sw1#show mac address-table | in 0/20
10 0014.a80a.f716 STATIC Fa0/20
10 0014.a80a.f741 STATIC Fa0/20
sw1#
10 0014.a80a.f716 STATIC Fa0/20
10 0014.a80a.f741 STATIC Fa0/20
sw1#
sw2#show running-config int f0/20
Building configuration…
Current configuration : 312 bytes
!
interface FastEthernet0/20
switchport access vlan 10
switchport mode access
switchport port-security maximum 2
switchport port-security
switchport port-security mac-address sticky
switchport port-security mac-address sticky 001a.a164.b216
switchport port-security mac-address sticky 001a.a164.b241
end
Building configuration…
Current configuration : 312 bytes
!
interface FastEthernet0/20
switchport access vlan 10
switchport mode access
switchport port-security maximum 2
switchport port-security
switchport port-security mac-address sticky
switchport port-security mac-address sticky 001a.a164.b216
switchport port-security mac-address sticky 001a.a164.b241
end
sw1#show int f0/20 | in Hardware
Hardware is Fast Ethernet, address is 001a.a164.b216 (bia 001a.a164.b216)
sw1#show int vlan 10 | in Hardware
Hardware is EtherSVI, address is 001a.a164.b241 (bia 001a.a164.b241)
Hardware is Fast Ethernet, address is 001a.a164.b216 (bia 001a.a164.b216)
sw1#show int vlan 10 | in Hardware
Hardware is EtherSVI, address is 001a.a164.b241 (bia 001a.a164.b241)
sw2#show mac address-table | in 0/20
10 001a.a164.b216 STATIC Fa0/20
10 001a.a164.b241 STATIC Fa0/20
10 001a.a164.b216 STATIC Fa0/20
10 001a.a164.b241 STATIC Fa0/20
—因為機架無法預設中間加入其它二層裝置,但是可以通過往互聯介面所在vlan新增其他介面來測試,因為介面收到其他mac地址的包,介面會down。
本文轉自 碧雲天 51CTO部落格,原文連結:http://blog.51cto.com/333234/1318930,如需轉載請自行聯絡原作者
相關文章
- 二層交換機埠模式模式
- 二層交換機 三層交換機 四層交換機的區別
- 二層交換機鏈路聚合、三層交換機鏈路聚合和三層交換機的單臂路由專案路由
- 二層、三層交換機和四層交換機的區別(轉)
- 核心交換機光纖埠級連線方式與型別型別
- 華為交換機埠安全詳解--埠隔離、環路檢測與埠安全
- VLAN與三層交換機
- 三層交換機怎麼設定路由連線路由
- 串列埠伺服器和光纖交換機有什麼不同串列埠伺服器
- 三層交換機怎麼設定vlan網路
- 【轉】交換機開發(二)—— 三層交換機報文轉發過程
- 利聯科技:揚州BGP伺服器的華為三層交換機和二層交換機的區別伺服器
- 三層交換機與路由器路由器
- 三層交換機技術解析(轉)
- 【轉】交換機開發(三)—— 深入分析三層網路交換機的原理和設計
- H3C三層交換機操作
- 程式設計師面試乾貨:漫談計算機網路:物理層 ----- 雙絞線&光纖?,從最底層開始瞭解計算機網路程式設計師面試計算機網路
- 華為網路技術-三層交換技術
- 三層交換技術解析
- 如何用第三層交換保證資料安全
- 光纖交換機埠模組更換導致資料庫IO頻繁100%資料庫
- 華為交換機和銳捷交換機埠隔離
- 關於光纖交換機種類大總結
- CISCO 9124光纖交換機除錯經歷除錯
- 從二層到七層交換機技術適用環境介紹(轉)
- DISK OPERATION ERROR,交換機級聯單模光纖鏈路故障解決Error
- 交換機埠安全總結
- 網路知識梳理--OSI七層網路與TCP/IP五層網路架構及二層/三層網路TCP架構
- 利用雲端來合理管理您的網線光纖測試認證專案解決方案
- 使用如今更智慧的光纖測試工具執行專家級光纖測試和認證
- 更改SW300光纖交換機的ip地址
- 用於安裝和維護光纖單模和多模的光纖網路測試套件套件
- 光纖測試儀設定基準的短跳線使用
- 網線和光纖測試及認證的解決方案
- 實驗十一 ——————二層交換基礎
- 路由器與三層交換機相連的方法路由器
- 三層交換機和路由器的比較(轉)路由器
- 三層網路結構(核心層、匯聚層 、接入層)