思科交換機的vlan的劃分和給vlan分配ip地址

Switch#configure ter
Switch#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#int
Switch(config)#interface  fas
Switch(config)#interface  fastEthernet 0/1
Switch(config-if)#swi
Switch(config-if)#switchport acc
Switch(config-if)#switchport access vlan 1
Switch(config-if)#exit
Switch(config)#int
Switch(config)#interface  fas
Switch(config)#interface  fastEthernet 0/2
Switch(config-if)#sw
Switch(config-if)#switchport acc
Switch(config-if)#switchport access vl
Switch(config-if)#switchport access vlan 1
Switch(config-if)#exit
Switch(config)#exit
Switch#
%SYS-5-CONFIG_I: Configured from console by console
Switch#ena
Switch#enable 
Switch#con
Switch#conf
Switch#configure ter
Switch#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#vlan 2
Switch(config-vlan)#exit
Switch(config)#exit
Switch#
%SYS-5-CONFIG_I: Configured from console by console
show vlan

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/1, Fa0/2, Fa0/3, Fa0/4
                                                Fa0/5, Fa0/6, Fa0/7, Fa0/8
                                                Fa0/9, Fa0/10, Fa0/11, Fa0/12
                                                Fa0/13, Fa0/14, Fa0/15, Fa0/16
                                                Fa0/17, Fa0/18, Fa0/19, Fa0/20
                                                Fa0/21, Fa0/22, Fa0/23, Fa0/24
2    VLAN0002                         active    
1002 fddi-default                     act/unsup 
1003 token-ring-default               act/unsup 
1004 fddinet-default                  act/unsup 
1005 trnet-default                    act/unsup 

VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1    enet  100001     1500  -      -      -        -    -        0      0
2    enet  100002     1500  -      -      -        -    -        0      0
1002 fddi  101002     1500  -      -      -        -    -        0      0   
1003 tr    101003     1500  -      -      -        -    -        0      0   
1004 fdnet 101004     1500  -      -      -        ieee -        0      0   

Switch#nt
Switch#conf
Switch#configure ter
Switch#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#int
Switch(config)#interface fas
Switch(config)#interface fastEthernet 0/3
Switch(config-if)#swi
Switch(config-if)#switchport mod
Switch(config-if)#switchport mode acc
Switch(config-if)#switchport mode access 
Switch(config-if)#siw
Switch(config-if)#swi
Switch(config-if)#switchport acc
Switch(config-if)#switchport access vl
Switch(config-if)#switchport access vlan 2
Switch(config-if)#exit
Switch(config)#int
Switch(config)#interface fas
Switch(config)#interface fastEthernet 0/4
Switch(config-if)#swi
Switch(config-if)#switchport mo
Switch(config-if)#switchport mode acc
Switch(config-if)#switchport mode access 
Switch(config-if)#swi
Switch(config-if)#switchport acc
Switch(config-if)#switchport access 0/4
                                    ^
% Invalid input detected at '^' marker.
    
Switch(config-if)#switchport access vlan 2
Switch(config-if)#exit
Switch(config)#
%LINK-5-CHANGED: Interface FastEthernet0/3, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down

%LINK-5-CHANGED: Interface FastEthernet0/3, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up









Switch con0 is now available






Press RETURN to get started.













Switch>enab
Switch>enable 
Switch#conf
Switch#configure ter
Switch#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#int
Switch(config)#interface fast
Switch(config)#interface fastEthernet 0/1
Switch(config-if)#ip ad
Switch(config-if)#ip ad
Switch(config-if)#ip add
Switch(config-if)#ip addr
Switch(config-if)#ip addre
Switch(config-if)#ip address 192.168.1.10 255.255.255.0
                  ^
% Invalid input detected at '^' marker.
    
Switch(config-if)#ip addr
Switch(config-if)#ex
Switch(config-if)#exit 
Switch(config)#int
Switch(config)#interf vl
Switch(config)#interf vlan 1
Switch(config-if)#ip add
Switch(config-if)#ex
Switch(config-if)#exit 
Switch(config)#interf vlan 1
Switch(config-if)#ip add
Switch(config-if)#ip address 192.168.1.10/24
                             ^
% Invalid input detected at '^' marker.
    
Switch(config-if)#ex
Switch(config-if)#exit 
Switch(config)#vlan 1
Switch(config-vlan)#ip add
Switch(config-vlan)#ex
Switch(config-vlan)#exit 
Switch(config)#int
Switch(config)#interface fas
Switch(config)#interface fastEthernet 0/1
Switch(config-if)#ip add
Switch(config-if)#exit
Switch(config)#int
Switch(config)#interf vlan 1
Switch(config-if)#ip add
Switch(config-if)#ip address 192.168.1.10 255.255.255.0
Switch(config-if)#no sh
Switch(config-if)#no shutdown 

Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up
Switch(config-if)#exit
Switch(config)#use
Switch(config)#username a
Switch(config)#pa
Switch(config)#pass
Switch(config)#user
Switch(config)#username a pass
Switch(config)#username a password b
Switch(config)#Li
Switch(config)#Line vty 0 9
Switch(config-line)#log
Switch(config-line)#login lo
Switch(config-line)#login local 
Switch(config-line)#exit
Switch(config)#ena
Switch(config)#enable pas
Switch(config)#enable password c
Switch(config)#
h.jpg

h.jpg

參考文獻:

cisco交換機配置vlan方法

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
  • 序言:七十年代末阻塑,一起剝皮案震驚了整個濱河市可款,隨后出現的幾起案子肛宋,更是在濱河造成了極大的恐慌久又,老刑警劉巖艳狐,帶你破解...
    沈念sama閱讀 221,635評論 6 515
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件院喜,死亡現場離奇詭異,居然都是意外死亡唠亚,警方通過查閱死者的電腦和手機蚪战,發(fā)現死者居然都...
    沈念sama閱讀 94,543評論 3 399
  • 文/潘曉璐 我一進店門牵现,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人邀桑,你說我怎么就攤上這事瞎疼。” “怎么了壁畸?”我有些...
    開封第一講書人閱讀 168,083評論 0 360
  • 文/不壞的土叔 我叫張陵贼急,是天一觀的道長。 經常有香客問我捏萍,道長太抓,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 59,640評論 1 296
  • 正文 為了忘掉前任令杈,我火速辦了婚禮走敌,結果婚禮上,老公的妹妹穿的比我還像新娘逗噩。我一直安慰自己掉丽,他們只是感情好,可當我...
    茶點故事閱讀 68,640評論 6 397
  • 文/花漫 我一把揭開白布异雁。 她就那樣靜靜地躺著捶障,像睡著了一般。 火紅的嫁衣襯著肌膚如雪片迅。 梳的紋絲不亂的頭發(fā)上残邀,一...
    開封第一講書人閱讀 52,262評論 1 308
  • 那天皆辽,我揣著相機與錄音柑蛇,去河邊找鬼。 笑死驱闷,一個胖子當著我的面吹牛耻台,可吹牛的內容都是我干的。 我是一名探鬼主播空另,決...
    沈念sama閱讀 40,833評論 3 421
  • 文/蒼蘭香墨 我猛地睜開眼盆耽,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了?” 一聲冷哼從身側響起摄杂,我...
    開封第一講書人閱讀 39,736評論 0 276
  • 序言:老撾萬榮一對情侶失蹤坝咐,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后析恢,有當地人在樹林里發(fā)現了一具尸體墨坚,經...
    沈念sama閱讀 46,280評論 1 319
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內容為張勛視角 年9月15日...
    茶點故事閱讀 38,369評論 3 340
  • 正文 我和宋清朗相戀三年映挂,在試婚紗的時候發(fā)現自己被綠了泽篮。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 40,503評論 1 352
  • 序言:一個原本活蹦亂跳的男人離奇死亡柑船,死狀恐怖帽撑,靈堂內的尸體忽然破棺而出,到底是詐尸還是另有隱情鞍时,我是刑警寧澤亏拉,帶...
    沈念sama閱讀 36,185評論 5 350
  • 正文 年R本政府宣布,位于F島的核電站寸癌,受9級特大地震影響专筷,放射性物質發(fā)生泄漏。R本人自食惡果不足惜蒸苇,卻給世界環(huán)境...
    茶點故事閱讀 41,870評論 3 333
  • 文/蒙蒙 一磷蛹、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧溪烤,春花似錦味咳、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,340評論 0 24
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至鸳兽,卻和暖如春掂铐,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背揍异。 一陣腳步聲響...
    開封第一講書人閱讀 33,460評論 1 272
  • 我被黑心中介騙來泰國打工全陨, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人衷掷。 一個月前我還...
    沈念sama閱讀 48,909評論 3 376
  • 正文 我出身青樓辱姨,卻偏偏與公主長得像,于是被迫代替她去往敵國和親戚嗅。 傳聞我的和親對象是個殘疾皇子雨涛,可洞房花燭夜當晚...
    茶點故事閱讀 45,512評論 2 359

推薦閱讀更多精彩內容