Community discussions

 
neutronlaser
Member Candidate
Member Candidate
Topic Author
Posts: 212
Joined: Thu Jan 18, 2018 5:18 pm

Routing between bridges - Using wifi bridge

Wed Mar 07, 2018 3:05 pm

Hi

I have a normal cable modem setup with a Mikrotik router. In the area, there is also a Spectrum (ISP) hotspot which the customer has access to. I would like to be able to switch to using this for internet access.

I've created a second bridge, a wifi interface in station mode that connects to the Spectrum hotspot, and a DHCP client on that second bridge. It successfully gets an IP address.

To test it out, I want to just try routing access to one IP address (my web site).

I tried adding a new route with Dst. Address of my web site, and the second bridge as the gateway.

Am I missing something? Perhaps I should be adding some kind of masquerade, and/or the route gateway should be the Wlan, not the Bridge?
 
erfanurmia
newbie
Posts: 28
Joined: Wed Mar 07, 2018 11:14 am
Contact:

Re: Routing between bridges - Using wifi bridge

Wed Mar 07, 2018 4:58 pm

have you internet access by cable at modem??
you give internet to router and want pass internet to your lan network with wireless interface
step1:you set ip to wireless interface
step2:set dhcp on wireless interface
step3:masquerade the subnet of wireless IP

this is a solution for your problem that i know
 
sindy
Forum Guru
Forum Guru
Posts: 3959
Joined: Mon Dec 04, 2017 9:19 pm

Re: Routing between bridges - Using wifi bridge

Sat Mar 10, 2018 5:23 pm

I tried adding a new route with Dst. Address of my web site, and the second bridge as the gateway.
Am I missing something? Perhaps I should be adding some kind of masquerade, and/or the route gateway should be the Wlan, not the Bridge?
You can only specify an interface as route's gateway if the interface is a point-to-point one. Otherwise, you have to specify an IP address as route's gateway. The latter is definitely the case for the wireless interface.

As your two WAN interfaces are connected to different providers, each of them has a different IP subnet and a different gateway IP in that subnet. To learn the gateway for the WAN interface, configure the DHCP client to accept the default gateway but give it a distance of 2 and more, so that it wouldn't compete with the default gateway configured or received via DHCP from the primary WAN uplink (which likely has distance=1)

Then, display the table of IP routes, you will see the IP address of the gateway received from the wireless ISP. Add a route towards your web server with that IP address as a gateway.

To make it work not only for the Mikrotik itself but also for devices connected to its LAN, your ip firewall nat rules must contain a masquerade rule in srcnat chain for both WAN interfaces (you can use interface list for that).

For a backup or load balancing configuration, you have to configure the routes statically, or use a dhcp client script to change the configuration if eventually you would get a different gateway with each DHCP address allocation (which is not very likely, though).
Instead of writing novels, post /export hide-sensitive. Use find&replace in your favourite text editor to systematically replace all occurrences of each public IP address potentially identifying you by a distinctive pattern such as my.public.ip.1.
 
neutronlaser
Member Candidate
Member Candidate
Topic Author
Posts: 212
Joined: Thu Jan 18, 2018 5:18 pm

Re: Routing between bridges - Using wifi bridge

Sat Mar 10, 2018 5:41 pm

Thank you all.

Who is online

Users browsing this forum: MSN [Bot] and 107 guests