注:本配置在routeOS 3.30 (MikroTik RouterOS 3.30)上适用
一、一般命令说明:
1. routeOS是采用类linux的系统 其命令是用文件夹/目录 方式组织起来的。如你要设IP地址就要进到 /ip/address 这个目录中,不然就得打目录+命令的全名
2. .. (回上一级目录) / (回根目录) print (显示本目类命令录下的配置) add (添加一个配置) remove (删除一个配置)
enable (启用一个配置) disable (禁用一个配置)
二、命令使用示例:
1. 配置IP地址:
[admin@MikroTik] /ip address> add address=172.30.218.148/24 interface=ether1
2. 配置路由:
[admin@MikroTik] /ip route> add dst-address=0.0.0.0/0 gateway=192.168.3.1
3. 显示当前配置的地址:
[admin@MikroTik] /ip address> print
Flags: X - disabled, I - invalid, D - dynamic
# ADDRESS NETWORK BROADCAST INTERFACE
0 172.30.218.147/24 172.30.218.0 172.30.218.255 ether1
1 192.168.3.250/24 192.168.3.0 192.168.3.255 ether2
2 172.30.218.148/24 172.30.218.0 172.30.218.255 ether1
4. 显示当前配置的路由:
[admin@MikroTik] /ip route> print
Flags: X - disabled, A - active, D - dynamic,
C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme,
B - blackhole, U - unreachable, P - prohibit
# DST-ADDRESS PREF-SRC G GATEWAY DISTANCE INTERFACE
0 A S 0.0.0.0/0 r 192.168.3.1 1 ether2
1 ADC 172.30.218.0/24 172.30.218.147 0 ether1
2 ADC 192.168.3.0/24 192.168.3.250 0 ether2
3 A S 192.168.91.0/24 r 172.30.218.1 1 ether1
5. 显示当前配置的接口:
[admin@MikroTik] /ip route> /interface print
Flags: D - dynamic, X - disabled, R - running, S - slave
# NAME TYPE MTU L2MTU
0 R ether1 ether 1500
1 R ether2 ether 1500
6. 删除一个配置:
[admin@MikroTik] > ip address print
Flags: X - disabled, I - invalid, D - dynamic
# ADDRESS NETWORK BROADCAST INTERFACE
0 172.30.218.147/24 172.30.218.0 172.30.218.255 ether1
1 192.168.3.250/24 192.168.3.0 192.168.3.255 ether2
2 172.30.218.148/24 172.30.218.0 172.30.218.255 ether1
[admin@MikroTik] > ip address remove 2
7. 清空所有配置:
[admin@MikroTik] > setup
Setup uses Safe Mode. It means that all changes that are made during setup
are reverted in case of error, or if Ctrl-C is used to abort setup. To keep
changes exit setup using the 'x' key.
Hijacking Safe Mode from someone - unroll/release/don't take it [u/r/d]: 114
Released someone's Safe Mode
[Safe Mode taken]
Choose options by pressing one of the letters in the left column, before
dash. Pressing 'x' will exit current menu, pressing Enter key will select the
entry that is marked by an '*'. You can abort setup at any time by pressing
Ctrl-C.
Entries marked by '+' are already configured.
Entries marked by '-' cannot be used yet.
Entries marked by 'X' cannot be used without installing additional packages.
r - reset all router configuration
+ l - load interface driver
+ a - configure ip address and gateway
d - setup dhcp client
* s - setup dhcp server
p - setup pppoe client
t - setup pptp client
x - exit menu
your choice [press Enter to setup dhcp server]:r