Comprei um Mikrotik e Agora?

Prática de como conectar seu Mikrotik a internet em três cenários diferentes (ip dinâmico privado, pppoe e ip fixo público).

Cenário 1 (ip dinâmico privado)

/interface ethernet
set [ find default-name=ether1 ] name=ether1-wan
set [ find default-name=ether2 ] name=ether2-lan

/ip pool
add name=dhcp_pool0 ranges=192.168.100.2-192.168.100.254

/ip dhcp-server
add address-pool=dhcp_pool0 interface=ether2-lan lease-time=3d10m name=dhcp1

/ip address
add address=192.168.100.1/24 interface=ether2-lan network=192.168.100.0

/ip dhcp-client
add interface=ether1-wan

/ip dhcp-server network
add address=192.168.100.0/24 gateway=192.168.100.1

/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1-wan

Cenário 2 (pppoe)

/interface ethernet
set [ find default-name=ether1 ] name=ether1-wan
set [ find default-name=ether2 ] name=ether2-lan

/interface pppoe-client
add add-default-route=yes disabled=no interface=ether1-wan name=pppoe-vivo \
    service-name=Vivo user=cliente@cliente

/ip pool
add name=dhcp_pool0 ranges=192.168.100.2-192.168.100.254

/ip dhcp-server
add address-pool=dhcp_pool0 interface=ether2-lan lease-time=3d10m name=dhcp1

/ip address
add address=192.168.100.1/24 interface=ether2-lan network=192.168.100.0

/ip dhcp-server network
add address=192.168.100.0/24 gateway=192.168.100.1

/ip firewall nat
add action=masquerade chain=srcnat out-interface=pppoe-vivo

Cenário 3 (ip fixo público)

/interface ethernet
set [ find default-name=ether1 ] name=ether1-wan
set [ find default-name=ether2 ] name=ether2-lan

/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik

/ip pool
add name=dhcp_pool0 ranges=192.168.100.2-192.168.100.254

/ip dhcp-server
add address-pool=dhcp_pool0 interface=ether2-lan lease-time=3d10m name=dhcp1

/ip address
add address=192.168.100.1/24 interface=ether2-lan network=192.168.100.0
add address=191.175.30.2/30 interface=ether1-wan network=191.175.30.0

/ip dhcp-server network
add address=192.168.100.0/24 gateway=192.168.100.1

/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1-wan

/ip route
add disabled=no dst-address=0.0.0.0/0 gateway=191.175.30.1 routing-table=main \
    suppress-hw-offload=no
twitterlinkedin