汇聚层交换机ospf的network命令介绍
1、n7-14-b2-2的ospf network部分配置如下router ospf 1
network 172.30.164.0 0.0.0.255 area 0.0.0.14
network 172.30.152.0 0.0.0.255 area 0.0.0.14
network 172.26.3.4 0.0.0.0 area 0.0.0.14
network 172.26.8.41 0.0.0.0 area 0.0.0.14
network 172.30.143.0 0.0.0.255 area 0.0.0.14
network 172.30.144.0 0.0.0.255 area 0.0.0.14
network 172.30.145.0 0.0.0.255 area 0.0.0.14
network 172.30.146.0 0.0.0.255 area 0.0.0.14
network 172.30.147.0 0.0.0.255 area 0.0.0.14
network 172.30.148.0 0.0.0.255 area 0.0.0.14
network 172.30.149.0 0.0.0.255 area 0.0.0.14
network 172.30.150.0 0.0.0.255 area 0.0.0.14
network 172.30.151.0 0.0.0.255 area 0.0.0.14
network 172.30.155.0 0.0.0.255 area 0.0.0.14
network 172.30.156.0 0.0.0.255 area 0.0.0.14
network 172.30.157.0 0.0.0.255 area 0.0.0.14
network 172.30.158.0 0.0.0.255 area 0.0.0.14
network 172.30.159.0 0.0.0.255 area 0.0.0.14
network 172.30.160.0 0.0.0.255 area 0.0.0.14
network 172.30.161.0 0.0.0.255 area 0.0.0.14
network 172.30.162.0 0.0.0.255 area 0.0.0.14
network 172.30.163.0 0.0.0.255 area 0.0.0.14
area 0.0.0.14 stub no-summary
redistribute connected subnets
!
注意其中没有使用汇总,直接把每个c类的网络加了进去。
拿172.30.152.0、24举例子:
interface vlan 20
ip address 172.30.152.253 255.255.255.0
no shutdown
set port vlan ge.2.14 20
set port vlan ge.2.15 20
set port vlan ge.2.16 20
set port vlan ge.2.17 20
set port vlan ge.2.18 20
set port vlan ge.2.19 20
set port vlan ge.2.20 20
set port vlan ge.2.21 20
set port vlan ge.2.22 20
set port vlan ge.2.23 20
set port vlan ge.2.24 20
set port vlan ge.2.25 20
set port vlan ge.2.26 20
set port vlan ge.2.27 20
set port vlan ge.2.28 20
set port vlan ge.2.29 20
set port vlan ge.2.30 20
set port vlan ge.2.31 20
set port vlan ge.2.32 20
set port vlan ge.2.33 20
set port vlan ge.2.34 20
set port vlan ge.2.35 20
set port vlan ge.2.36 20
set port vlan ge.2.37 20
set port vlan ge.2.38 20
set port vlan ge.2.39 20
set port vlan ge.2.40 20
!
绛旓細1銆乶7-14-b2-2鐨ospf network閮ㄥ垎閰嶇疆濡備笅 router ospf 1 network 172.30.164.0 0.0.0.255 area 0.0.0.14 network 172.30.152.0 0.0.0.255 area 0.0.0.14 network 172.26.3.4 0.0.0.0 area 0.0.0.14 network 172.26.8.41 0.0.0.0 area 0.0.0.14 network 172.3...
绛旓細鏍稿績灞傦紝浣滀负缃戠粶鐨勫績鑴忥紝閫氬父鐢变笁灞浜ゆ崲鏈鏋勬垚銆傚畠浠笌姹囪仛浜ゆ崲鏈轰互涓夊眰鎺ュ彛鐩歌繛锛OSPF鍗忚鍦ㄦ杩愯锛屽疄鐜板叏灞璺敱鐨勭鐞嗗拰浼樺寲銆傛湁鏃讹紝閫氳繃璁剧疆AS锛堣嚜娌荤郴缁燂級锛屾牳蹇冨眰杩樿兘杩涜璺敱绛栫暐鐨勭伒娲婚噸鍒嗗竷锛屼负缃戠粶鎻愪緵浜嗘洿澶х殑鐏垫椿鎬с傚浜庢暟鎹腑蹇冿紝缃戠粶鏋舵瀯鏇翠负澶氬厓鍖栥備竴绉嶅父瑙佺殑鍙樺寲鏄紝鏍稿績姹囪仛灞淇濇寔涓夊眰缁...
绛旓細VLANip搴旇鍙埌姹囪仛灞傦紝鏍稿績灞傚彧鍋氬揩閫熺殑娴侀噺杞彂銆傛垜瑙夊緱姹囪仛灞傚簲璇ユ槸涓涓暣浣擄紝姹囪仛灞傜殑鍔熻兘鍙互鐢ㄦ潵涓夊眰杞彂鍜屽仛涓浜沘cl鐨勶紝浣犺繖鏍锋帴绾挎病鏈夊啑浣欏姛鑳斤紝瑕佹槸姹囪仛灞傛湁涓鍙版寕浜嗭紝瀵瑰簲涓嬮潰鐨勬帴鍏ュ眰閮芥寕浜嗭紝鏃㈢劧姹囪仛灞傛湁涓ゅ彴浜ゆ崲鏈哄簲璇ュ湪鎺ュ叆灞傜殑浜ゆ崲鏈鐢ㄤ袱鏍圭嚎鍒嗗埆鎺ュ叆鍒颁袱涓眹鑱氬眰璁惧锛屾眹鑱氬眰鍋氱綉鍏冲啑浣...
绛旓細绗竴姝ワ細鏍稿績璺敱鍣ㄥ拰涓夊眰SW涔嬮棿璺OSPF锛堟垨鑰呯敤HSRP銆乂RRP閮藉彲浠ワ紝鍏蜂綋閰嶇疆鑷繁鎵撅級锛屼笁灞係W涔嬮棿璺慣RUNK锛屽厑璁稿繀瑕佺殑vlan閫忎紶锛涚浜屾锛氫笁灞係W瀵逛笅涔熼厤缃瓾SRP鎴朧RRP锛岄偅涔堜綘鐨凱C鎴栨湇鍔″櫒鐨勭綉鍏筹紝灏辨寚鍚慔SRP锛圴RRP锛夌殑娴姩鍦板潃锛涙敞鎰忥細浜屽眰SW涓婅閾捐矾鏈濂芥槸涓ゆ潯锛屼竴涓繛涓伙紝涓涓繛澶 绗笁锛氶噸瑕佺殑涓鐐...
绛旓細1.PC1鐨勭綉鍏砳p浣嶄簬姹囪仛浜ゆ崲鏈篈,PC2鐨勭綉鍏矷P浣嶄簬姹囪仛浜ゆ崲鏈築,榛樿鍧囦负vlan 1; 2.鏍稿績浜ゆ崲鏈篈 涓庢牳蹇冧氦鎹㈡満B 閲囩敤VRRP瀹炵幇楂樺彲鐢,鍙屾満浜掕仈绔彛閲囩敤浜屽眰鑱氬悎; 3.鏍稿績浜ゆ崲鏈篈 鎸囧畾涓篤lan 194 鍜 vlan 192 鐨勬牴妗(bridge root),鏍稿績浜ゆ崲鏈築鎸囧畾涓簐lan195 鍜寁lan193鐨勬牴妗(bridge root); 姹囪仛灞備氦鎹㈡満A: #...
绛旓細璇寸殑娌¢敊锛屼絾鏄繖鏄袱涓蹇碉細OSPF鏄矾鐢卞崗璁紝鏄繍琛屽湪瀛愮綉闂寸殑銆傝孲TP鏄敓鎴愭爲鍗忚锛屾槸淇濊瘉鍦ㄥ眬鍩熺綉鍐呴儴鏃犵幆鐨勶紝涓昏鏄槻姝㈢幆璺箍鎾鏆淬
绛旓細浜诧紝浣犳湁绛旀浜嗗悧锛熸垜涔熷湪鍋氳繖閬撻
绛旓細鍦ㄦ鎯宠鏄庝竴涓媀RRP鐨勪綔鐢紝瀹冧富瑕佹槸鍋氶粯璁ょ綉鍏崇殑璺敱鍐椾綑鐨勶紝涓鑸敤浜庝富鍓摼璺鎺ョ殑鏃跺欑殑璺敱鍐椾綑锛屽綋涓婚摼璺け鏁堣嚜鍔ㄥ垏鎹㈠埌鍓摼璺笂銆備綘杩欎釜鎷撴墤鍥惧ソ鍍忔病鏈夎繖鏍风殑缁撴瀯锛屾帴鍏ュ眰鍒姹囪仛灞傜殑STP鏄摼璺啑浣欙紝姹囪仛灞傚埌鏍稿績灞傜敤璺敱鍗忚OSPF瀹炵幇鏈浣宠矾鐢便傚鏋滆瀹炵幇VRRP鍦ㄦ眹鑱氬眰涓夊眰浜ゆ崲鏈涓婂疄鐜板嵆鍙紝涓嶉渶瑕...
绛旓細1銆佷氦鎹㈡満涓庝氦鎹㈡満鐩歌繛鐨勭鍙i厤缃垚trunk Switch(config)#interface range f0/1-2 Switch(config-if-range)#sw m t 2銆佸垱寤虹浉搴旂殑vlan锛堟湰姹囪仛灞備氦鎹㈡満浠ヤ笅鎵鏈塿lan)Switch(config)#vlan 10 enable conf t vlan 10 vlan 20 vlan 30 interface range f0/1-3 switchport trunk en do switchport ...
绛旓細姹囪仛褰撶劧寰楄窇璺敱鍔熻兘浜 寮鍚浜ゆ崲鏈虹殑ip routing ! 鍏蜂綋鐢ㄤ粈涔堝崗璁湅浣犵殑缃戠粶澶у皬浜 濡傛灉缃戠粶 涓鑸湁涓300 鍙 宸﹀彸 pc 鐨勮瘽璺戜釜rip 涔熷氨澶熶簡 绋嶅井澶х偣鐨勫彲浠ヨ冭檻璺ospf 锛 router ospf 1 network 192.168.1.0 0.0.0.255 area 0 銆傝寰楄繕濂界殑 缁欎釜婊℃剰鍛 锛