用户视图:刚开始登入交换机时的视图,一般看到的是尖括号<>

save                                // 配置完交换机后保存当前配置的命令
system-view                         // 进入系统视图的命令
clock timezone BJ add|minus 8       // 设置时区
clock datetime 16:36:00 2020-07-01  // 设置交换机的时间
dis cu                              // 显示当前配置
dis cu int                          // 显示当前接口配置
系统视图: 在用户视图下输入system-view后进入系统视图,一般为方括号[]
sysname xxxx                                       //修改交换机设备名,不支持中文
user-interface console 0                           //进入第0个console口的用户界面
authentication-mode passwd                         //配置从console口登入交换机的认证模式为密码认证
set authentication password cipher admin@123       //配置从console口登入交换机的密码

- 阅读全文 -

清空存储设备中的下次启动配置文件中的配置信息,并取消指定系统下次启动时使用的配置文件。

<HUAWEI> reset saved-configuration   \执行此命令
Warning: The action will delete the saved configuration in the device.          
The configuration will be erased to reconfigure. Continue? [Y/N]:y              
Warning: Now clearing the configuration in the device.                          
Info: Succeeded in clearing the configuration in the device. 

在BootROM下清除Console口密码登录后,修改Console口密码
设备的BootROM提供了清除Console口密码的功能,可以在用户使用Console口登录的时候跳过密码检查。这样系统启动后除了不需要输入Console密码外,与正常启动相同,也会完成所有配置加载。设备启动后修改Console口密码,然后保存配置。
注意:
• 要进入到BootROM菜单需要重启设备,会导致业务中断,请视具体情况做好设备备份,并尽量选择业务量较少的时间操作。
• 清除Console口密码登录后请马上配置新的密码。
• 在此操作过程中不要对设备进行下电。

01.    用串口线连接设备,然后重启。当出现“Press Ctrl+B to enter BootROM menu...”(V200R002及V200R003版本)或者“Press Ctrl+B or Ctrl+E to enter BootROM menu ...”(V200R005及以后发布的版本)打印信息时,按下“Ctrl+B”或者“Ctrl+E”并键入密码(缺省为“Admin@huawei.com”,V100R006C03之前版本可能为“huawei”),进入BootROM主菜单。
02.    清除Console口登录密码。
03.              BootROM  MENU
04.    
05.        1. Boot with default mode
06.        2. Enter serial submenu
07.        3. Enter startup submenu
08.        4. Enter ethernet submenu
09.        5. Enter filesystem submenu
10.        6. Modify BootROM password   //V200R006及之前版本:Modify BootROM password V200R007及之后版本:Enter password submenu
11.        7. Clear password for console user
12.        8. Reboot
13.        (Press Ctrl+E to enter diag menu) 
14.    
15.    Enter your choice(1-8): 7
16.    
17.    Note: Clear password for console user? Yes or No(Y/N): y
18.    
19.    Clear password for console user successfully. Choose "1" to boot, then set a new password.
Note: Do not choose "8. Reboot" or power off the device, otherwise this operation will not take effect.
20.    根据设备的提示,在BootROM主菜单下选择“1”启动设备。
21.    完成系统启动后,通过Console口登录时不需要认证,登录后配置Console口密码,以修改为密码认证,并修改密码为“huawei@123”为例。
22.    <HUAWEI> system-view
23.    [HUAWEI] user-interface console 0
24.    [HUAWEI-ui-console0] authentication-mode password
25.    [HUAWEI-ui-console0] set authentication password cipher huawei@123
[HUAWEI-ui-console0] return
26.    为了防止重启后配置丢失,保存配置。
27.    <HUAWEI> save
28.    The current configuration will be written to the device.
29.    Are you sure to continue?[Y/N]y
30.    Now saving the current configuration to the slot 0.
Save the configuration successfully.

Mikrotik 的 RouterBoard 硬件产品默认都有带有配置良好的防火墙规则,x86/CHR 设备默认不带防火墙规则。 如果你不小心删掉了防火墙规则,或者需要还原默认防火墙规则,可以导入以下配置:

第一部分: Interface List,所有设备均需要导入,请根据自己情况适当修改

/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface list member
add interface=bridge list=LAN
add interface=ether1 list=WAN
add interface=pppoe-out1 list=WAN

第二部分:IPv4 防火墙规则,推荐所有设备都导入

/ip firewall filter
add action=accept chain=input comment="accept ping" protocol=icmp
add action=accept chain=input comment="accept established,related,untracked" connection-state=established,related,untracked
add action=drop chain=input comment="drop invalid" connection-state=invalid
add action=drop chain=input comment="drop all from WAN" in-interface-list=WAN
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" connection-state=established,related
add action=accept chain=forward comment="accept established,related, untracked" connection-state=established,related,untracked
add action=drop chain=forward comment="drop invalid" connection-state=invalid
add action=drop chain=forward comment="drop all from WAN not DSTNATed" connection-nat-state=!dstnat connection-state=new in-interface-list=WAN

因为各大运营商会不定时的强行中断 PPPoE 连接,为了避免白天连接被断开的情况,可以在半夜不用的时候自己主动重连一次 PPPoE,以避免白天被强行中断。

/system scheduler
add name="restart pppoe" on-event="/interface pppoe-client enable pppoe-telecom" \
start-time=03:00:00 interval=1d 
/interface disable pppoe-wan1
:delay 30
/interface enable pppoe-wan1
只需将上述代码中的 pppoe-wan1 更换为你 PPPoE 连接的名称,start-time 修改为你想重连的时间即可。