配置交换机,从基础开始。
以下是配置的交换机命令。(HUAWEI S3000)
配置过程(// 后面为注释)
1.改变中文模式
language-mode chinese //习惯英语的可以不用此步骤
2.进入系统试图
system-view
3.设置特权密码:
super password cipher NIMEI //设置特权密文密码为NIMEI
super password level 3 cipher NIMEI //优先等级为3级 密文密码为NIMEI
4.创建vlan 1801:
vlan 1801 //创建1801vlan(1-2048随便选,除管理vlan)
port ethernet 0/1 to ethernet 0/23 //允许1-23口通过vlan1801
quit //退出
设置TRUNK:
interface ethernet 0/24 //进入24口
port link-tybe trunk //设置为trunk口
port trunk permit vlan all //设置允许所有vlan通过trunk口
quit //退出
5.创建管理VLAN:
vlan 2 //创建管理vlan2
management-vlan 2 //管理vlan2
interface vlan 2 //进入vlan2
ip address 192.168.1.232 255.255.255.0 //设置ip地址
quit //退出
6.开启telnet:
local-user wlzx //建立本地用户wlzx(名字随便定,因为我是学校网络中心的,所以以wlzx起名)
password simple 1 //设置明文密码为1
service-type telnet //telnet服务类型
quit //退出
user-interface vty 0 4 //进入虚拟终端
Authentication-mode scheme //身份验证模式计划
Protocol inbound all //指定所在的用户接口支持所有协议
User privilege level 3 //等级为3级
quit //退出
7.设置SNMP:
snmp-agent community read CanoMe0s //设置SNMP的团体访问名以及对应的MIB视图和访问控制列表 命名为CanoMe0s(这个名字貌似是固定的)
snmp-agent sys-info version all //这个貌似是全局试图查看
8.设置静态路由:
ip route-static 0.0.0.0 0.0.0.0 192.168.1.254 //设置静态路由
9.保存
save 以下为代码#
sysname Quidway
#
super password level 3 cipher R('XM05JYB`
radius scheme system
server-type huawei
primary authentication 127.0.0.1 1645
primary accounting 127.0.0.1 1646
user-name-format without-domaindomain system
radius-scheme system
access-limit disable
state active
vlan-assignment-mode integer
idle-cut disable
self-service-url disable
messenger time disabledomain default enable system
#
local-server nas-ip 127.0.0.1 key huaweilocal-user wlzx
password cipher M\>.IRGDG)X>`PG:,B5U`Q!!
service-type telnet level 1
#
temperature-limit 0 42 65
#
management-vlan 2
#
vlan 1
#
vlan 2
#
vlan 1801
#
interface Vlan-interface2
ip address 192.168.1.232 255.255.255.0
#
interface Aux0/0
#
interface Ethernet0/1
port access vlan 1801
#
interface Ethernet0/2
port access vlan 1801
#
interface Ethernet0/3
port access vlan 1801
#
interface Ethernet0/4
port access vlan 1801
#
interface Ethernet0/5
port access vlan 1801
#
interface Ethernet0/6
port access vlan 1801
#
interface Ethernet0/7
port access vlan 1801
#
interface Ethernet0/8
port access vlan 1801
#
interface Ethernet0/9
port access vlan 1801
#
interface Ethernet0/10
port access vlan 1801
#
interface Ethernet0/11
port access vlan 1801
#
interface Ethernet0/12
port access vlan 1801
#
interface Ethernet0/13
port access vlan 1801
#
interface Ethernet0/14
port access vlan 1801
#
interface Ethernet0/15
port access vlan 1801
#
interface Ethernet0/16
port access vlan 1801
#
interface Ethernet0/17
port access vlan 1801
#
interface Ethernet0/18
port access vlan 1801
#
interface Ethernet0/19
port access vlan 1801
#
interface Ethernet0/20
port access vlan 1801
#
interface Ethernet0/21
port access vlan 1801
#
interface Ethernet0/22
port access vlan 1801
#
interface Ethernet0/23
port access vlan 1801
#
interface Ethernet0/24
port link-type trunk
port trunk permit vlan all
#
interface NULL0
#
ip route-static 0.0.0.0 0.0.0.0 192.168.1.254 preference 60
#
snmp-agent
snmp-agent local-engineid 800007DB000FE2222CE16877
snmp-agent community read CanoMe0s
snmp-agent sys-info location BeiJing China
snmp-agent sys-info version all
#
user-interface aux 0
user-interface vty 0 4
authentication-mode scheme
user privilege level 3
#
return
首先你得看看你ip地址和交换机的ip地址是不是一类的,还有你得看看有没有把你计算机和交换机接的那个口有没有划到可以上网的vlan里面。接口是access或是truck的无关紧要(不是通过多个交换机多个vlan上网) 如何设置ip我想你应该会的
首先要知道你交换机的上行线带不带VLAN标签的,如不带,则交换机不用作任何设置只在电脑上设上相应的IP地址,就可以上网了
如果带VLAN标签,要了解VLAN号是多少,如是100的话,
例
interface GigabitEthernet0/0/2 交换机的上行口
port link-type trunk
port trunk allow-pass vlan 100
interface Ethernet0/0/1 接你电脑的那个网口
port link-type access
port default vlan 100
电脑上设置相应的IP地址就可以上网了