设置系统时间和所在地区
[HUAWEI]clock datetime 12:00:00 2022-10-18 //设置系统时间
[HUAWEI]clock timezone BJ add 08:00:00 //设置时区
[HUAWEI]display clock //查看系统时间
2022-10-18 07:50:07+8:00
Thursday
Time Zone(BJ) : UTC+08:00
设置语言模式
[HUAWEI]language-mode Chinese
Change language mode,confirm? [Y/N] Y
提示:改变语言模式成功
IP地址设置
PC端设置IP地址:直接双击进行配置
路由器设置IP地址
[HUAWEI]int e0/0/0
[HUAWEI-Ethernet0/0/0]ip add 192.168.1.0 24
//192.168.1.0为IP地址 24为子网掩码的简写
交换机设置IP
- 进入vlan :int vl10
- 设置IP地址:ip add 192.168.1.0 24
- 进入端口:int g0/0/1
- 设置端口模式:port link-type access //设置为accesss端口,access端口只允许一个vlan通过。
- port default vl 10
静态路由
[HUAWEI] ip route-static 192.168.2.0 255.255.255.0 0.0.02
192.168.2.0为目标网段,255.255.255.0为子网掩码,0.0.0.2为下一跳路由器地址。
静态路由应用于非直连状态
动态路由(适用于大型网络)
RIP
- 进入RIP:rip
- network+直连网段
OSPF
- 进入ospf:ospf
- area 0 //0为配置区域,0为骨干区域,非0为非骨干区域,非骨干区域需要和骨干区域相连
- network 1.1.1.0 0.0.255 //1.1.1.0为直连网段 0.0.0.255为反子网掩码
单臂路由(实现vlan之间能够互联)
路由器
- 进入子接口:int g0/0/1
- 配置IP: ip address 192.168.1.254
- 封装: dotlq termination vid 10
- 开启广播功能:arp broadcast enable //如果不配置,子接口无法主动发送arp报文,以及向外转发arp报文
交换机
- 创建vlan:vl bat 10
- 进入端口:int g0/0/1
- 分配端口:port link-type access port default vlan 10 access用于交换机与PC端间 只允许配置vl通过 trunk允许所有vl通过
- trunk:port link-type trunk port trunk allow-pass vlan all
配置网关
- 进入子接口:int g0/0/1
- 配置IP:ip address 192.168.2.254 24
- 封装:dotlg termination vid 10
密码模式
- console口需要使用CTL线
- 进入路由器
- 进入console 口:user-interface console 0
- 设置简单密码模式:authentication-mode password
- 选择方式:set authentication password cipher 密码 user privilege lavel 3 其中3为用户级别
- 使用copper线连接
- user-interface vty 0 4 //进入vty0到4接口
- authentication-mode password 然后输入密码
- user privilege level 1 设置级别
AAA(比密码模式多了一个用户名 在路由器配置)
- 使用console口
- user-interface console 0
- authentication-mode aaa
- 返回上一级进入aaa (aaa)
- local-user 用户名 password ciphet 密码
- local-user 用户名 privilege level 3
DHCP:主机动态获取IP地址
- 在路由器配置
- 开启DHCP:dhcp enable
- 创建一个全局地址池:ip pool 地址池名称
- network 192.168.4.0 mask 255.255.255.0 动态分配192.168.1.0地址范围,如不指定掩码,则默认使用自然掩码
- lease day 2 全局地址池写的地址租期,默认为1天
- gateway-list 192.168.4.254 配置DHCP客户端的网关地址
- 添加排斥地址:excluded-ip-address 192.168.4.250 192.168.4.253
- 定义dns网关:dns-list 8.8.8.8
- 进入端口:interface g0/0/0
- // 11.12为方法二
- 定义网关:ip add 192.168.1.254
- 开启接口DHCP功能:dhcp select global 指定接口采用全局地址池为客户端配置
链路聚合
- 在交换机配置
- Eth-Trunk模式(手工)
- 创建链路聚合:interface Eth-Trunnk 1
- 指定为手工负载分担模式:mode manualload-balance
- 进入端口:interface g0/0/0
- 加入到Eth-Trunk1接口:eth-trunk 1