Community discussions

MikroTik App
 
oguruma
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 83
Joined: Sat Jun 04, 2022 8:55 pm

Lab: Configuring WAN interfaces/gateways

Sun Jun 26, 2022 9:47 pm

I want to build a lab to play around with RouterOS and networking setups in general.

I have an existing router/switch for my home to use. In general, how does one go about configuring a RouterOS router such that I can connect it to my existing switch to get out to the internet?
 
User avatar
Buckeye
Forum Veteran
Forum Veteran
Posts: 887
Joined: Tue Sep 11, 2018 2:03 am
Location: Ohio, USA

Re: Lab: Configuring WAN interfaces/gateways

Mon Jun 27, 2022 10:20 am

I want to build a lab to play around with RouterOS and networking setups in general.

I have an existing router/switch for my home to use. In general, how does one go about configuring a RouterOS router such that I can connect it to my existing switch to get out to the internet?
Just connect your new MikroTik router's WAN interface to your current internet router's LAN (or to a switch connected to the LAN), tell the MikroTik to get it's Internet address via DHCP (your current internet router will stand in for the ISP of the MikroTik) and make sure you configure the new MikroTik router's LAN to be a different subnet than your existing internet router's LAN subnet. After you do this, everything should just "work". The MikroTik will get its "internet connection" from the upstream router, and there will be two stages of NAT going on, but you should be able to access the internet from a PC connected to the LAN interface of your new "lab" router.

If your existing internet router isn't a MikroTik, the new MikroTik will probably work with the default LAN address of 192.168.88.1/24, since your existing router probably uses a LAN address of 192.168.1.1/24 or 192.168.0.1/24 and will give out addresses to dhcp clients from the same subnet. You can use any rfc1918 address you want for the MikroTik's LAN, just make sure it does not overlap your current router's LAN subnet.

Toasty Answer's has some "white board" videos on putting a rourter behind another router. For example these two What is Double NAT? and Edgerouter with Existing Network (but the same rules apply to any router, including MikroTik ROS)
Last edited by Buckeye on Mon Jun 27, 2022 12:56 pm, edited 1 time in total.
 
Machello
newbie
Posts: 27
Joined: Fri Dec 04, 2020 3:22 pm

Re: Lab: Configuring WAN interfaces/gateways

Mon Jun 27, 2022 12:42 pm

To connect the Mikrotik behind the existing router/switch all you need to do is setup the Mikrotik as a Bridge under Configuration in Quick Set. You can then add all the ports and wlans to the default bridge. After that all you need to is go to IP > DHCP Client and add in new DHCP Client with the following settings:

Assuming your default bridge is named "bridge1". [Can be found under Bridge section]
Assuming all Ethernet and Wireless interfaces is added as ports to "bridge1" [Can be found under Bridge/Ports section]
Assuming "bridge1" is set up as LAN under Interface List and is the only one in Interface list (Delete all others) [Can be found under Interfaces/Interface List section]
Assuming the router has the default firewall rules (there does not have to be any firewall rules at all) and DHCP Server is turned off on the mikrotik.
Assuming the router has no address at all (Delete if there is any). [Can be found under IP/Addresses]

Interface: bridge1
Use Peer DNS: Checked
Use Peer NTP: Checked
Add Default Route: Yes

So what this does is the same as a Windows based computer with IPv4/IPv6 settings set to automatic. This configuration basically makes you're mikrotik act like an unmanned switch. The Mikrotik will automatically find what ever ethernet or wireless port a DHCP Server is running on and get an IP address and DNS addresses from it. You will then see under IP/Addresses section that "bridge1" has an IP address assigned to it and "bridge1" will be the main interface for the mikrotik. You will also find DNS server address is also automatically configured under IP/DNS section as Dynamic servers. If there is no DNS server addresses you will have to add 8.8.8.8 and 8.8.4.4 manually. All other devices plugged into the ports of "bridge1" will also find IP and DNS addresses automatically. If those devices connected to the mikrotik and also the mikrotik itself does not find DNS Addresses automatically then there is something not configured correctly on the existing router's DHCP server or you're ISP does not provide DNS server addresses.

If you are having trouble you can skip out on the switch and connect your existing router directly to the mikrotik.

Who is online

Users browsing this forum: menyarito, mkx, tesme33 and 43 guests