Professional Documents
Culture Documents
RB Default Config
RB Default Config
ult configuration"
filter add chain=input action=accept connection-state=establishe
d comment="default configuration"
filter add chain=input action=accept connection-state=related co
mment="default configuration"
filter add chain=input action=drop in-interface=ether1-gateway c
omment="default configuration"
nat add chain=srcnat out-interface=ether1-gateway action=masquer
ade comment="default configuration"
}
/tool mac-server remove [find];
/tool mac-server mac-winbox disable [find];
:foreach k in=[/interface find] do={
:local tmpName [/interface get $k name];
:if (!($tmpName~"ether1")) do={
/tool mac-server add interface=$tmpName disabled=no;
/tool mac-server mac-winbox add interface=$tmpName disab
led=no;
}
}
/ip neighbor discovery set [find name="ether1-gateway"] discover=no
/ip dns {
set allow-remote-requests=yes
static add name=router address=192.168.88.1
}
}
#------------------------------------------------------------------------------# Revert configuration.
# these commands are executed if user requests to remove default configuration
#------------------------------------------------------------------------------:if ($action = "revert") do={
# remove wan port protection
/ip firewall {
:local o [nat find comment="default configuration"]
:if ([:len $o] != 0) do={ nat remove $o }
:local o [filter find comment="default configuration"]
:if ([:len $o] != 0) do={ filter remove $o }
}
/tool mac-server remove [find]
/tool mac-server add interface=all disabled=no
/tool mac-server mac-winbox remove [find interface!=all]
/tool mac-server mac-winbox set [find] disabled=no
# reset wan ports;
/ip neighbor discovery set [find name="ether1-gateway"] discover=yes
/interface set "ether1-gateway" name=ether1;
:if ($dhcpEnabled = 1) do={
:local o [/ip dhcp-server network find comment="default configur
ation"]
:if ([:len $o] != 0) do={ /ip dhcp-server network remove $o }
:local o [/ip dhcp-server find name="default" address-pool="defa
ult-dhcp" interface="ether2-master-local" !disabled]
:if ([:len $o] != 0) do={ /ip dhcp-server remove $o }
/ip pool {
:local o [find name="default-dhcp" ranges=192.168.88.10192.168.88.254]
:if ([:len $o] != 0) do={ remove $o }
}
:local o [/ip dhcp-client find comment="default configuration"]