From 4f93b95f84832dd7e88cd57610050febb21a1fdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9F=B3=E8=89=AF=E6=B6=9B?= <12071381+shiliangtao@user.noreply.gitee.com> Date: Sat, 27 Apr 2024 14:56:06 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 石良涛 <12071381+shiliangtao@user.noreply.gitee.com> --- .../20240426 OSPF.md" | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 "\347\237\263\350\211\257\346\266\233/20240426 OSPF.md" diff --git "a/\347\237\263\350\211\257\346\266\233/20240426 OSPF.md" "b/\347\237\263\350\211\257\346\266\233/20240426 OSPF.md" new file mode 100644 index 0000000..169aae0 --- /dev/null +++ "b/\347\237\263\350\211\257\346\266\233/20240426 OSPF.md" @@ -0,0 +1,29 @@ +#### 1、动态路由ospf协议 + +```java +router(config)router ospf xxx /启动协议 + +router(config-router)network xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx(反掩码)area xxx + +/ 宣告自己的接口 或网段在ospf 的区域中可以把不同接口宣告在不同区域中 +``` + +#### 2、转换路由模式、启用路由功能 + +```java +Switch(config)#ip routing /设置三层交换机为路由模式 +Switch (config-if)#no switchport /启用三层功能 +``` + +#### 3、三层交换机实现VLAN通信 + +```java +SW3(config)int f0/1 进入端口 +SW3(config-if)sw mode trunk 与二层交换机相连的端口设置trunk模式 +SW3(config)int f0/2 进入端口 +SW3(config-if)sw access vlan 2 与PC电脑相连的端口设置 vlan 2 +SW3(config)#int vlan 2 进入vlan的虚拟接口 +SW3(config-if)#ip add IP地址 子网掩码 +``` + +![](img\image-20240426170921666.png) -- Gitee