网站管理vlan配置命令

实验:

密码配置(全部相同): 

Switch>enable
Switch#configure
Configuring from terminal, memory, or network [terminal]? 
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#no ip domain-lookup//当输入错误命令时不进行搜索
Switch(config)#service password-encryption//对密码进行加密,否则密码是明文密码
Switch(config)#enable secret class
Switch(config)#banner motd # Unauthorized access is strictly prohibited. #//似乎用于初始化,但是没有查到确切解释。
Switch(config)#line con 0
Switch(config-line)#password ciso
Switch(config-line)#login
Switch(config-line)#logging synchronous//日志同步
Switch(config-line)#line vty 0 15
Switch(config-line)#password ciso
Switch(config-line)#login
Switch(config-line)#exit

S1

//配置端口网络号
Switch(config)#hostname S1
S1(config)#interface vlan 99
S1(config-if)#ip address 192.168.99.11 255.255.255.0
S1(config-if)#no shutdown
S1(config-if)#ip default-gateway 192.168.99.1
S1(config)#interface range f0/1-24
S1(config-if-range)#shutdown
S1(config-if-range)#end
S1#
%SYS-5-CONFIG_I: Configured from console by console

S1#
S1#wr
Building configuration...
[OK]



//进入vlan的配置
S1(config)#vlan 10
S1(config-vlan)#name Students//区别vlan
S1(config-vlan)#vlan 20
S1(config-vlan)#name Faculty
S1(config-vlan)#vlan 99
S1(config-vlan)#name Management
S1(config-vlan)#exit

//配端口
S1(config)#interface f0/1
S1(config-if)#switchport trunk native vlan 99//配置trunk端口
S1(config-if)#switchport mode trunk// 强制接口成为Trunk接口,并且主动诱使对方成为Trunk模式,所以当邻居交换机接口为trunk/desirable/auto时会成为Trunk 接口。 
S1(config-if)#no shutdown

S1(config-if)#interface f0/5
S1(config-if)#switchport trunk native vlan 99
S1(config-if)#switchport mode trunk
S1(config-if)#no shutdown

S1(config-if)#interface f0/6
S1(config-if)#switchport mode access	
S1(config-if)#switchport access vlan 10
S1(config-if)#no shutdown
S1(config-if)#



S2基本同上

Switch#configure
Configuring from terminal, memory, or network [terminal]? 
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#hostname S2//重命名
S2(config)#interface range f0/1-24	
S2(config-if-range)#shutdown//关闭其余端口(平时没有这一条命令也行)
S2(config-if-range)#interface vlan 99
S2(config-if)#ip address 192.168.99.12 255.255.255.0
S2(config-if)#no shutdown
S2(config-if)#exit
S2(config)#ip ?//查询命令
  access-list      Named access-list
  arp              IP ARP global configuration
  default-gateway  Specify default gateway (if not routing IP)
  dhcp             Configure DHCP server and relay parameters
  domain           IP DNS Resolver
  domain-lookup    Enable IP Domain Name System hostname translation
  domain-name      Define the default domain name
  ftp              FTP configuration commands
  host             Add an entry to the ip hostname table
  name-server      Specify address of name server to use
  scp              Scp commands
  ssh              Configure ssh options
S2(config)#ip default-gateway 192.168.99.1
S2(config)#end
S2#
S2#wr
Building configuration...
[OK]
S2#
S2#configure
Configuring from terminal, memory, or network [terminal]? 
Enter configuration commands, one per line.  End with CNTL/Z.
S2(config)#



S2(config)#interface f0/18
S2(config-if)#switchport
% Incomplete command.
S2(config-if)#switchport mode access
S2(config-if)#switchport access vlan 20
% Access VLAN does not exist. Creating vlan 20
S2(config-if)#no shutdown

	
S2(config-if)#end
S2#
%SYS-5-CONFIG_I: Configured from console by console

S2#wr
Building configuration...
[OK]

R1

R1>enable
R1#configure
Configuring from terminal, memory, or network [terminal]? 
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#interface g0/1.10
R1(config-subif)#encapsulation dot1q 10//配置以太网子接口vlan号,封装格式为802.1q。
R1(config-subif)#ip address 192.168.10.1 255.255.255.0
R1(config-subif)#interface g0/1.20
R1(config-subif)#encapsulation dot1q 20
R1(config-subif)#ip address 192.168.20.1 255.255.255.0
R1(config-subif)#interface g0/1.99
R1(config-subif)#encapsulation dot1q 99 native
R1(config-subif)#ip address 192.168.99.1 255.255.255.0
R1(config-subif)#interface g0/1
R1(config-if)#no shutdown
R1(config-if)#end
R1#wr
Building configuration...

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值