配置vlan

来源:互联网 发布:淘宝网碎花连衣裙 编辑:程序博客网 时间:2024/05/16 05:26
Continue with configuration dialog? [y/n]:                                          Continue with configuration dialog? [y/n]:                                          switch>       switch>enable        switch#             switch#show vlan                VLAN Name         Type       Media     Ports                                            ---- ------------ ---------- --------- ----------------------------------------                                                                               1    default      Static     ENET      Ethernet0/0/1       Ethernet0/0/2                                                                                                               Ethernet0/0/3       Ethernet0/0/4                                                                                                               Ethernet0/0/5       Ethernet0/0/                                                                                                            Ethernet0/0/7       Ethernet0/0/8                                                                                                               Ethernet0/0/9       Ethernet0/0/10                                                                                                                Ethernet0/0/11      Ethernet0/0/12                                                                         switch#  config t               switch(Config)#vlan 2                     switch(Config-Vlan2)#switch interface ethernet 0/0/11-12                                       Set the port Ethernet0/0/11 access vlan 2 successfully                                                      Set the port Ethernet0/0/12 access vlan 2 successfully                                                      switch(Config-Vlan2)#exit                         switch(Config)#exit                   switch#write            switch#conf t             switch(Config)#vlan 2                     switch(Config-Vlan2)#switchport interface ethernet ?                                                      <WORD>                   -- Interface list(input interface and/or the                                                                                                     interface ranges divided by semicolon(;). such                                                                                                          as e0/0/1;e0/0/3;e0/0/5-8) <1-100> character                                                                          switch(Config-Vlan2)#switchport interface ethernet 0/0/11-12                                                            Set the port Ethernet0/0/11 access vlan 2 successfully                                                      Set the port Ethernet0/0/12 access vlan 2 successfully                                                      switch(Config-Vlan2)#                     switch#show vlan                VLAN Name         Type                                   ---- ------------ ---------- --------- ----------------------------------------                                                                               1    default      Static     ENET      Ethernet0/0/1       Ethernet0/0/2                                                                                                               Ethernet0/0/3       Ethernet0/0/4                                                                                                               Ethernet0/0/5       Ethernet0/0/6                                                                                                               Ethernet0/0/7       Ethernet0/0/8                                                                                                               Ethernet0/0/9       Ethernet0/0/10                                                                         2    VLAN0002     Static     ENET      Ethernet0/0/11      Ethernet0/                                                                    switch#   write               switch#       Continue with configuration dialog? [y/n]:                                          switch(Config)#int vlan 1                         20:42:07: %LINK-5-CHANGED: Interface Vlan1, changed state to UP                                                               %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to UP                                                                          switch(Config-If-Vlan1)#ip address 192.168.13.1 255.255.255.0                                                             switch(Config-If-Vlan1)#int vlan 1                                  switch(Config-If-Vlan1)#int vlan 2                                  20:42:20: %LINK-5-CHANGED: Interface Vlan2, changed state to UP                                                               %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan2, changed state to UP                                                                          switch(Config-If-Vlan2)#ip address 192.168.14.1 255.255.255.                                                           switch(Config-If-Vlan2)#                        switch#write            switch#show run               Current configuration:                      !    hostname switch                  ! ! Vlan 1         vlan 1         ! Vlan 2         vlan 2         ! ! Interface Ethernet0/0/1                       ! Interface Ethernet0/0/2                       ! Interface Ethernet0/0/3                       ! Interface Ethernet0/0/4                       ! Interface Ethernet0/0/5                       ! Interface Ethernet0/0/6                       ! Interface Ethernet0/0/7                       ! Interface Ethernet0/0/8                       ! Interface Ethernet0/0/9                          switchport access vlan 2                           ! Interface Ethernet0/0/10                           switchport access vlan 2                           ! Interface Ethernet0/0/11                           switchport access vlan 2                           ! Interface Ethernet                    switchport access vlan 2                           ! ! interface Vlan1                  interface vlan 1                      ip address 192.168.13.1 255.255.255.0                                        ! ! interface Vlan2                  interface vlan 2                      ip address 192.168.14.1 255.255.255.0                                        ! ! switch#write            switch#       switch#       switch#       switch#       switch#       switch#conf           switch>       switch>       switch>       switch>       switch>       switch>       switch>       switch>en         switch#conf t             switch(Config)#int vlan 1                         19:48:11: %LINK-5-CHANGED: Interface Vlan1, changed state to UP                                                               %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to UP                                                                          switch(Config-If-Vlan1)#ip address 192.168.16.1 255.255.255.0                                                             switch(Config-If-Vlan1)#int vlan 2                                  19:48:34: %LINK-5-CHANGED: Interface Vlan2, changed state to UP                                                               switch(Config-If-Vlan2)#ip address 192.168.17.1 255.255.255.0                                                             switch(Config-If-Vlan2)#                        switch#write            switch#sh run             Current configuration:                      !    hostname switch                  ! ! Vlan 1         vlan 1         ! Vlan 2         vlan 2         ! ! Interface Ethernet0/0/1                       ! Interface Ethernet0/0/2                       ! Interface Ethernet0/0/3                       ! Interface Ethernet0/0/4                       ! Interface Ethernet0/0/5                       ! Interface Ethernet0/0/6                       ! Interface Ethernet0/0/7                       ! Interface Ethernet0/0/8                       ! Interface Ethernet0/0/9                       ! Interface Ethernet0/0/10                        ! Interface Ethernet0/0/11                           switchport access vlan 2                           ! Interface Ethernet0/0/12                           switchport access vlan 2                           ! ! interface Vlan1                  interface vlan 1                      ip address 192.168.16.1 255.255.255.0                                        ! ! interface Vlan2                  interface vlan 2                      ip address 192.168.17.1 255.255.255.0                                        ! ! switch#show vlan                VLAN Name         Type       Media     Ports---- ------------ ---------- --------- ----------------------------------------1    default      Static     ENET      Ethernet0/0/1       Ethernet0/0/2                                       Ethernet0/0/3       Ethernet0/0/4                                       Ethernet0/0/5       Ethernet0/0/6                                       Ethernet0/0/7       Ethernet0/0/8                                       Ethernet0/0/9       Ethernet0/0/102    VLAN0002     Static     ENET      Ethernet0/0/11      Ethernet0/0/12switch#switch(Config)#switch(Config)#switch(Config)#exitswitch#sh vlanVLAN Name         Type       Media     Ports---- ------------ ---------- --------- ----------------------------------------1    default      Static     ENET      Ethernet0/0/1       Ethernet0/0/2                                       Ethernet0/0/3       Ethernet0/0/4                                       Ethernet0/0/5       Ethernet0/0/6                                       Ethernet0/0/7       Ethernet0/0/82    VLAN0002     Static     ENET      Ethernet0/0/9       Ethernet0/0/10                                       Ethernet0/0/11      Ethernet0/0/12switch#  20:44:52: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0/12,changed state to UP