IP綜合實驗

1.配置eth-trunk進行綁定

[LSW1]interface Eth-Trunk 0

[LSW1-Eth-Trunk0]q

[LSW1]interface g0/0/2

[LSW1-GigabitEthernet0/0/2]eth-trunk 0

[LSW1-GigabitEthernet0/0/2]int g0/0/3? ?
[LSW1-GigabitEthernet0/0/3]eth-trunk 0

[LSW1-GigabitEthernet0/0/3]display eth-trunk 0

2.創建vlan,劃分接口類型

[LSW1]vlan 2

[LSW1]port-group group-member g0/0/4 to g0/0/5 Eth-Trunk 0

[LSW1-port-group]port link-type trunk?
[LSW1-GigabitEthernet0/0/4]port link-type trunk?
[LSW1-GigabitEthernet0/0/5]port link-type trunk?

[LSW1-port-group]port trunk allow-pass vlan 2
[LSW1-GigabitEthernet0/0/4]port trunk allow-pass vlan 2
[LSW1-GigabitEthernet0/0/5]port trunk allow-pass vlan 2
[LSW1-Eth-Trunk0]port trunk allow-pass vlan 2

[LSW2]vlan 2
[LSW2-vlan2]q
[LSW2]port-group group-member g0/0/4 to g0/0/5 Eth-Trunk 0
[LSW2-port-group]port trunk allow-pass vlan 2
[LSW2-Eth-Trunk0]port trunk allow-pass vlan 2

[LSW3]vlan 2
[LSW3-vlan2]q
[LSW3-Ethernet0/0/3]int e0/0/4
[LSW3-Ethernet0/0/4]port link-type access
[LSW3-Ethernet0/0/4]port default vlan 2
[LSW3-Ethernet0/0/4]q?
[LSW3]port-group group-member e0/0/1 to e0/0/2?
[LSW3-port-group]port link-type trunk
[LSW3-port-group]port trunk allow-pass vlan 2
?

[LSW4]vlan 2
[LSW4-vlan2]q
[LSW4]int e0/0/4
[LSW4-Ethernet0/0/4]port link-type access?
[LSW4-Ethernet0/0/4]port default vlan 2
[LSW4-Ethernet0/0/4]q
[LSW4]port-group group-member e0/0/1 to e0/0/2
[LSW4-port-group]port link-type trunk
[LSW4-port-group]port trunk allow-pass vlan 2
?

3.配置生成樹:

[LSW1]stp region-configuration?
[LSW1-mst-region]region-name a
[LSW1-mst-region]instance 1 vlan 1
[LSW1-mst-region]instance 2 vlan 2
[LSW1-mst-region]active region-configuration?

[LSW1]stp instance 1 root primary
[LSW1]stp instance 2 root secondary?

[LSW1]stp instance 0 root primary?

[LSW2]stp region-configuration?
[LSW2-mst-region]instance 1 vlan 1
[LSW2-mst-region]instance 2 vlan 2
[LSW2-mst-region]active region-configuration?

[LSW2]stp instance 1 root secondary?
[LSW2]stp instance 2 root primary?

[LSW2]stp instance 0 root secondary?

[LSW3]stp region-configuration?
[LSW3-mst-region]region-name a
[LSW3-mst-region]instance 1 vlan 1
[LSW3-mst-region]instance 2 vlan 2
[LSW3-mst-region]active region-configuration?

[LSW4]stp region-configuration?
[LSW4-mst-region]region-name a
[LSW4-mst-region]instance 1 vlan 1
[LSW4-mst-region]instance 2 vlan 2
[LSW4-mst-region]active region-configuration

[LSW3]port-group group-member e0/0/1 to e0/0/2
[LSW3-port-group]stp edged-port enable?

[LSW3]int e0/0/3
[LSW3-Ethernet0/0/3]stp instance 0 port priority 16

5.配置ip地址SVI:

[LSW1]int vlan 1
[LSW1-Vlanif1]ip add?? ?
[LSW1-Vlanif1]ip address 172.16.1.1 25
[LSW1-Vlanif1]int vlan 2
[LSW1-Vlanif2]ip address 172.16.1.129 25

[LSW1-Vlanif2]display ip interface brief

[LSW2]int vlan 1
[LSW2-Vlanif1]ip address 172.16.1.2 25
[LSW2-Vlanif1]int vlan 2
[LSW2-Vlanif2]ip address 172.16.1.130 25
[LSW2-Vlanif2]display ip interface brief

6.進行網關冗余VRRP:

[LSW1]int vlan 1?
[LSW1-Vlanif1]vrrp vrid 1 virtual-ip 172.16.1.126?
[LSW1-Vlanif1]vrrp vrid 1 priority 110?
[LSW1-Vlanif1]vrrp vrid 1 track interface g0/0/1 reduced 20

[LSW1]int vlan 2
[LSW1-Vlanif2]vrrp vrid 1 virtual-ip 172.16.1.254


[LSW2]int vlan 1
[LSW2-Vlanif1]vrrp vrid 1 virtual-ip 172.16.1.126(vrid、virtual-ip需和LSW1保持一致)

[LSW2]int vlan 2
[LSW2-Vlanif2]vrrp vrid 1 virtual-ip 172.16.1.254
[LSW2-Vlanif2]vrrp vrid 1 priority 110
[LSW2-Vlanif2]vrrp vrid 1 track int g0/0/1 reduced ?20

7.配置DHCP獲取IP地址:

[LSW1]dhcp enable?
[LSW1]ip pool a1
[LSW1-ip-pool-a1]net 172.16.1.0 mask 25
[LSW1-ip-pool-a1]gateway-list 172.16.1.126 ?
[LSW1-ip-pool-a1]dns-list 114.114.114.114
[LSW1-ip-pool-a1]q
[LSW1]ip pool a2
[LSW1-ip-pool-a2]net 172.16.1.128 mask 25
[LSW1-ip-pool-a2]gateway-list 172.16.1.254
[LSW1-ip-pool-a2]dns-list 114.114.114.114
[LSW1-ip-pool-a2]q
[LSW1]int vlan 1 ? ?
[LSW1-Vlanif1]dhcp select global?
[LSW1-Vlanif1]int vlan 2
[LSW1-Vlanif2]dhcp select global?

[SW2]dhcp enable
[SW2]ip pool a1
Info:It's successful to create an IP address pool.
[SW2-ip-pool-a1]net 172.16.1.0 mask 25
[SW2-ip-pool-a1]gateway-list 172.16.1.126 ??
[SW2-ip-pool-a1]dns-list 114.114.114.114
[SW2-ip-pool-a1]q
[SW2]ip pool a2
Info:It's successful to create an IP address pool.
[SW2-ip-pool-a2]net 172.16.1.128 mask 25 ??
[SW2-ip-pool-a2]gateway-list 172.16.1.254
[SW2-ip-pool-a2]dns-list 114.114.114.114
[SW2-ip-pool-a2]q
[SW2]int vlan 1
[SW2-Vlanif1]dhcp select global?
[SW2-Vlanif1]int vlan 2
[SW2-Vlanif2]dhcp select global?

8.對于上層路由器進行連接

[SW1]vlan 99
[SW1-GigabitEthernet0/0/2]int g0/0/1
[SW1-GigabitEthernet0/0/1]port link-type access?
[SW1-GigabitEthernet0/0/1]port default vlan 99
[SW1]int vlan 99
[SW1-Vlanif99]ip add 172.16.0.2 30

[SW2]vlan 99
[SW2-vlan99]int g0/0/1?
[SW2-GigabitEthernet0/0/1]port link-type access ?
[SW2-GigabitEthernet0/0/1]q
[SW2]int vlan 99
[SW2-Vlanif99]ip add 172.16.0.6 30

9.配置沉默接口:

[LSW1]ospf 1

[SW1-ospf-1]silent-interface all
[SW1-ospf-1]undo silent-interface GigabitEthernet 0/0/1
[SW1-ospf-1]undo silent-interface Vlanif 99
[SW1-ospf-1]undo silent-interface Eth-Trunk 0
[SW1-ospf-1]undo silent-interface Vlanif 1
[SW2]ospf 1
[SW2-ospf-1]silent-interface all
[SW2-ospf-1]undo silent-interface GigabitEthernet 0/0/1
[SW2-ospf-1]undo silent-interface Vlanif 99
[SW2-ospf-1]undo silent-interface Eth-Trunk 0 ?
[SW2-ospf-1]undo silent-interface Vlanif 1

三、配置路由器部分:

1.配置ospf協議

[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]net 172.16.0.0 0.0.0.255

[SW1]ospf 1 router-id 3.3.3.3

[SW1-ospf-1]area 0
[SW1-ospf-1-area-0.0.0.0]net 172.16.0.2 0.0.0.0
[SW1-ospf-1]area 1
[SW1-ospf-1-area-0.0.0.1]net 172.16.1.0 0.0.0.255
[SW1-ospf-1-area-0.0.0.1]

[SW2]ospf 1 router-id 4.4.4.4
[SW2-ospf-1]area 0?
[SW2-ospf-1-area-0.0.0.0]net 172.16.0.6 0.0.0.0
[SW2-ospf-1-area-0.0.0.0]q
[SW2-ospf-1]area 1
[SW2-ospf-1-area-0.0.0.1]net 172.16.1.0 0.0.0.255

2.配置缺省路由

[R2]ip route-static 0.0.0.0 0 12.1.1.1

[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]default-route-advertise?

3.進行路由匯總:

[SW1]ospf 1
[SW1-ospf-1]area 1
[SW1-ospf-1-area-0.0.0.1]abr-summary 172.16.1.0 255.255.255.0

[SW2]ospf 1
[SW2-ospf-1]area 1
[SW2-ospf-1-area-0.0.0.1]abr-summary 172.16.1.0 255.255.255.0

4.防止路由黑洞

[SW1]ip route-static 172.16.1.0 24 NULL 0

[SW2]ip route-static 172.16.1.0 24 NULL 0

5.配置nat,進行上網:

[R2]acl 2000
[R2-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R2-acl-basic-2000]q
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]nat outbound 2000

確定 ISP 連接接口及 IP 配置

  1. 明確 R1?與 ISP 相連的接口(假設為?GE 0/0/0?) ,在 R1上僅進行 IP 地址相關配置。若已知 ISP 側 IP 地址為?12.1.1.1?,則在 R1?設備上配置:

plaintext

[R1]interface GE0/0/0
[R1-GigabitEthernet0/0/0]ip address 12.1.1.2 30

此配置僅為接口設置 IP 地址,符合 “只能配置 IP 地址” 的要求 。

確保連接及路由可達

  1. 鏈路連通性測試:在 R1?上使用?ping?命令測試與 ISP 的連通性,如?ping 12.1.1.1?,確保物理鏈路和 IP 層連通正常。
  2. 路由配置:在 R1?及相關網絡設備(如 LSW1、LSW2 等 )上,通過 OSPF 等動態路由協議(已配置情況下 )或靜態路由,保證內網到 ISP 方向路由可達。例如在 R1?上,已配置缺省路由?[R1]ip route-static 0.0.0.0 0 12.1.1.1?,將所有未知流量導向 ISP ;在 LSW1 和 LSW2 上,通過 OSPF 學習到前往 R2 及 ISP 方向的路由。

安全策略限制

為進一步確保 ISP 只能配置 IP 地址,可在 R2 上配置訪問控制列表(ACL ) ,限制對 ISP 設備的其他訪問操作(假設 ISP 設備不允許除 IP 配置外的其他遠程管理等操作 )。例如:

plaintext

[R1]acl 3000
[R1-acl-adv-3000]rule deny ip source any destination 12.1.1.1 0.0.0.0 (禁止內網主動訪問 ISP 除 IP 相關配置外的其他服務 )
[R1-acl-adv-3000]rule permit ip source 12.1.1.2 0.0.0.0 destination any (允許 R2 與 ISP 正常通信 )
[R1-acl-adv-3000]quit
[R1]interface GE0/0/0
[R1-GigabitEthernet0/0/0]traffic-filter inbound acl 3000 (在入方向應用 ACL 策略 )

通過以上操作,在網絡連接和安全控制層面實現 ISP 僅進行 IP 地址配置的要求 。

ping 12.1.1.1

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/diannao/76245.shtml
繁體地址,請注明出處:http://hk.pswp.cn/diannao/76245.shtml
英文地址,請注明出處:http://en.pswp.cn/diannao/76245.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

SAP 學習筆記 - 系統移行業務 - MALSY(由Excel 移行到SAP 的收費工具)

以前有關移行,也寫過一些文章,比如 SAP 學習筆記 - 系統移行業務 - Migration cockpit工具 - 移行Material(品目)-CSDN博客 SAP 學習筆記 - 系統移行業務 - Migration cockpit工具2 - Lot導入_sap cockpit-CSDN博客 SAP學習筆記…

二叉樹搜索樹與雙向鏈表

一:題目 二:思路 把二叉搜索樹的值升序的打印出來,中序打印即可,但是此題不僅僅是有序的打印出二叉搜索樹的值,而是要將其的結構也改變了,也就是說要改變節點間的指向,讓其成為一個雙向鏈表 我…

31天Python入門——第17天:初識面向對象

你好,我是安然無虞。 文章目錄 面向對象編程1. 什么是面向對象2. 類(class)3. 類的實例關于self 4. 對象的初始化5. __str__6. 類之間的關系繼承關系組合關系 7. 補充練習 面向對象編程 1. 什么是面向對象 面向對象編程是一種編程思想,它將現實世界的概念和關系映…

Spring Boot中常用內嵌數據庫(H2、HSQLDB、Derby)的對比,包含配置示例和關鍵差異總結

以下是Spring Boot中常用內嵌數據庫的對比,包含配置示例和關鍵差異總結: 一、主流內嵌數據庫對比 1. H2 數據庫 特點: 支持內存模式(速度快)和文件模式(數據持久化)。支持SQL方言&#xff08…

Apache Hive和Snowflake的`CREATE VIEW`語法和功能特性整理的對比表

寫一個Apache Hive中CREATE VIEW語句轉換為對應Snowflake中CREATE VIEW語句的程序,現在需要一個根據功能的相似性對應的Apache HiveQL和Snowflake SQL的CREATE VIEW語句的表。 以下是基于Apache Hive的CREATE VIEW語法規則構造的所有可能合法語句實例及其功能說明&…

個人博客網站從搭建到上線教程

步驟1:設計個人網站 設計個人博客網站的風格樣式,可以在各個模板網站上多瀏覽瀏覽,以便有更多設計網站風格樣式的經驗。 設計個人博客網站的內容,你希望你的網站包含哪些內容如你的個人基本信息介紹、你想分享的項目、你想分享的技術文檔等等。 步驟2:選擇開發技術棧 因…

PHP回調后門

1.系統命令執行 直接windows或liunx命令 各個程序 相應的函數 來實現 system exec shell_Exec passshru 2.執行代碼 eval assert php代碼 系統 <?php eval($_POST) <?php assert($_POST) 簡單的測試 回調后門函數call_user_func(1,2) 1是回調的函數 2是回調…

Raspberry 樹莓派 CM4模塊的底板設計注意事項

1&#xff0c; 樹莓派CM4底板設計 樹莓派CM4模塊集成了CPU&#xff0c; 存儲器&#xff0c;以太網&#xff0c; 無線模塊&#xff0c;電源等等&#xff0c; 大大降低了硬件設計的要求。對我們使用樹莓派提供了很好的便利性。 本人近期因為項目的需要設計了一款CM4的底板&#x…

Java后端開發(十八)-- 使用JAXB,將JavaBean轉換XML文本

下面是測試時的運行環境: 1.jdk8 2.Maven,可能需要需要的依賴,如下: <dependency><groupId>javax.xml.bind</groupId><artifactId>jaxb-api</artifactId><version>2.3.1</version></dependency><dependency><gr…

【一起來學kubernetes】30、k8s的java sdk怎么用

Kubernetes Java SDK 是開發者在 Java 應用中與 Kubernetes 集群交互的核心工具&#xff0c;支持資源管理、服務發現、配置操作等功能。 一、主流 Java SDK 對比與選擇 官方 client-java 庫 特點&#xff1a;由 Kubernetes 社區維護&#xff0c;API 與 Kubernetes 原生對象嚴格…

PHP開發者2025生存指南

PHP&#xff0c;這個曾經被戲稱為“世界上最好的語言”的腳本語言&#xff0c;依舊在網絡世界占據著重要的地位。然而&#xff0c;技術發展日新月異&#xff0c;面向2025年&#xff0c;PHP開發者要想保持競爭力甚至實現職業生涯的飛躍&#xff0c;需要不斷學習和提升自身技能。…

MySQL與Redis數據一致性保障方案詳解

前言 在現代分布式系統中&#xff0c;MySQL和Redis的結合使用非常普遍。MySQL作為關系型數據庫負責持久化存儲&#xff0c;而Redis則作為高性能緩存層提升系統的響應速度。然而&#xff0c;在這種架構下&#xff0c;如何保證MySQL與Redis之間的數據一致性是一個重要的挑戰。本…

MySQL響應慢是否由堵塞或死鎖引起?

目錄標題 **1. 檢查當前運行的查詢和進程****2. 查看死鎖日志****方法一&#xff1a;通過錯誤日志****方法二&#xff1a;通過InnoDB狀態** **3. 檢查鎖信息****查看表鎖****查看行鎖&#xff08;InnoDB&#xff09;** **4. 分析慢查詢****開啟慢查詢日志****分析慢查詢** **5.…

【計算機網絡】記錄一次校園網無法上網的解決方法

問題現象 環境&#xff1a;實訓室教室內時間&#xff1a;近期突然出現 &#xff08;推測是學校在施工&#xff0c;部分設備可能出現問題&#xff09;癥狀&#xff1a; 連接校園網 SWXY-WIFI 后&#xff1a; 連接速度極慢偶發無 IP 分配&#xff08;DHCP 失敗&#xff09;即使分…

JavaScript函數式編程思想

1. 相關面試題 1.1. 什么是純函數&#xff1f; 純函數是一種函數&#xff0c;其返回值僅由其輸入參數決定&#xff0c;不產生任何可觀察的副作用&#xff0c;如修改全局對象或外部狀態。 純函數具有以下特性&#xff1a; 1. 確定性&#xff1a;相同的輸入永遠得到相同的輸…

Elasticsearch安全與權限控制指南

在Elasticsearch維護中&#xff0c;安全管理是保障數據合規性和集群穩定性的關鍵。本文將詳細介紹用戶與角色管理、索引/字段級權限控制、HTTPS加密通信、審計日志與合規性檢查等核心安全實踐&#xff0c;希望可以幫助你構建更安全的Elasticsearch環境。 1 用戶與角色管理 1.1…

『VUE』快速入門配置環境使用tailwind css 記憶tailwind css常見規則 (詳細圖文注釋)

目錄 效果預覽快速入門環境配置配置 tailwind.config.js 設置文件添加 Tailwind 的基礎樣式引入樣式到項目檢查構建工具配置測試 Tailwind CSS 效果 使用插件tailwind.config.js的最終內容app.vue演示 為什么不需要記憶 Tailwind 的類名&#xff1f;1. 類名直觀2. 文檔全面3. 工…

StdioIterator

參考這種用法&#xff1a; int a[3]{1,2,3}; copy(a,a3,ostream_iterator<int>(cout," ")); 以及 ostream_iterator 類 | Microsoft Learn 中的函數簽名&#xff0c;可以編寫出 StdioIterator&#xff0c;同樣支持 copy 函數的調用。 #include <stdio.h&…

制作service列表并打印出來

制作service列表并打印出來 在Linux中&#xff0c;服務&#xff08;Service&#xff09;是指常駐在內存中的進程&#xff0c;這些進程通常監聽某個端口&#xff0c;等待其他程序的請求。服務也被稱為守護進程&#xff08;Daemon&#xff09;&#xff0c;它們提供了系統所需的各…

CKS認證 | Day3 K8s容器運行環境安全加固

一、最小特權原則&#xff08;POLP&#xff09; 1&#xff09;最小特權原則 (Principle of least privilege&#xff0c;POLP) &#xff1a; 是一種信息安全概念&#xff0c;即為用戶提供執行其工作職責所需的最 小權限等級或許可。 最小特權原則被廣泛認為是網絡安全的最佳實…