1、配置IP和掩码
<HUAWEI(guangkou-48)>system-view
[HUAWEI(guangkou-48)]interface Meth 0/0/1 # 这里需要根据实际情况配置,有可能是0/0/0
[HUAWEI(guangkou-48)-MEth0/0/1]ip address 192.168.2.250 255.255.255.0 # 前面是IP,后面掩码
[HUAWEI(guangkou-48)-MEth0/0/1]commit # 这里可能有些系列交换机没有这个命令,可以不用执行
[HUAWEI(guangkou-48)-MEth0/0/1]quit # 退出
2、配置网关
[HUAWEI(guangkou-48)]ip route-static 0.0.0.0 0.0.0.0 MEth 0/0/1 192.168.2.254 # 0/0/1需要跟前面一致,192.168.2.254是网关
[HUAWEI(guangkou-48)-MEth0/0/1]commit # 提交
[HUAWEI(guangkou-48)-MEth0/0/1]quit # 退出
[HUAWEI(guangkou-48)]quit # 再次退出系统视图
<HUAWEI(guangkou-48)>save # 保存
The current configuration will be written to flash:/vrpcfg.zip.
Are you sure to continue?[Y/N]y # 输入y
Now saving the current configuration to the slot 0.... # 这里可能会让你保存配置文件,随便输入文件名,然后以.cfg结尾,如:ip_config.cfg
Save the configuration successfully.
<HUAWEI(guangkou-48)> # 配置完成
配置完成后,可在交换机上ping一下网关。