一:基础配置
system-view //进入系统视图
sysname R1 //配置设备名为R1
interface GigabitEthernet 0/0/0 //进入g0/0/0接口
ip address 12.1.1.1 24 //配置接口地址为12.1.1.1,掩码长度为24
quit //退出上一个视图
return //直接退回到用户视图模式
save //保存设备配置
二、console配置
user-interface console 0 //进入console接口
idle-timeout 30 //配置用户连接的超时时间为30分钟
user privilege level 15 //配置用户页面用户级别是15
authentication-mode password //配置密码认证
set authentication password cipher huawei //配置本地用户登录密码是huawei
authentication-mode aaa //配置aaa认证方式
aaa //进入aaa模式
local-user admin password cipher huawei //配置账户是admin密码是huawei
三、telnet配置(配置和console相似)
user-interface vty 0 4 //进入远程配置vty0到4远程
四、VLAN配置
vlan 10 //创建单个vlan
vlan batch 15 20 to 30 //创建15 20到30多个VLAN
int g 0/0/1 //进入接口后
port link-type access //配置为accesss模式
port default vlan 10 //配置该接口属于vlan10
int g 0/0/3 //进入g 0/0/3
port link-type trunk //配置g 0/0/3为trunk模式
port trunk allow-pass vlan 10 //配置trunk链路放行vlan10
port trunk allow-pass vlan all //配置trunk链路放行所有vlan
五、链路聚合
int Eth-Trunk 0 //进入聚合端口0
mode lacp-static //配置聚合端口为lacp协商模式
trunkport g 0/0/3 //将0/0/3端口加入聚合端口
trunkport g 0/0/4 //将0/0/4端口加入聚合端口
mode manual load-balance //配置聚合端口为静态模式
load-balance src-dst-ip //配置聚合端口流量基于源目地址ip负载
六、VLAN间通信
interface Vlanif 10
ip address 192.168.10.1 24
七、静态路由和默认路由
ip route-static 0.0.0.0 0.0.0.0 192.168.100.1
ip route-static 192.168.1.0 255.255.255.0 192.168.100.2
ip route-static 192.168.1.0 255.255.255.0 192.168.100.2 preference
rip 1