Community discussions

MikroTik App
 
tabate47
Long time Member
Long time Member
Topic Author
Posts: 510
Joined: Wed Mar 13, 2013 5:23 am
Location: Los Angeles

Accessing device with different subnet

Sat Jan 28, 2017 9:59 pm

I have a device with a static 192.168.0.100/24 ip address. It comes that way out of the box. It is on the lan with a 192.168.47.0/24 config.

Is there a way I can access that device without changing my ip on my pc to something in the 192.168.0 range?

Thanks!
 
JB172
Member
Member
Posts: 304
Joined: Fri Jul 24, 2015 3:12 pm
Location: AWMN

Re: Accessing device with different subnet

Sat Jan 28, 2017 10:19 pm

Add a second ip to your pc
 
tabate47
Long time Member
Long time Member
Topic Author
Posts: 510
Joined: Wed Mar 13, 2013 5:23 am
Location: Los Angeles

Re: Accessing device with different subnet

Sat Jan 28, 2017 11:55 pm

That's not what I am looking for. I need a solution on the router end.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12008
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Accessing device with different subnet

Sun Jan 29, 2017 6:21 am

in the router add the ip 192.168.0.101/24 (if is free) on the bridge or interface where the device 192.168.0.100/24 can be reachable,

on firewall/NAT add src-nat src-add 192.168.0.0/24 dst-add 192.168.47.0/24 action masquerade
on firewall/NAT add src-nat src-add 192.168.47.0/24 dst-add 192.168.0.0/24 action masquerade

warning: the device 192.168.0.100/24 must have 192.168.0.101/24 as gateway!!!

if you can not change his gateway put also this:

and only if is needed: add src-nat dst-add 192.168.0.100 action src-add to address 192.168.0.101
Last edited by rextended on Sun Jan 29, 2017 7:16 am, edited 2 times in total.
 
tabate47
Long time Member
Long time Member
Topic Author
Posts: 510
Joined: Wed Mar 13, 2013 5:23 am
Location: Los Angeles

Re: Accessing device with different subnet

Sun Jan 29, 2017 7:01 am

There are not 2 routers...

There is one router with the lan set to 192.168.47.0/24.

The device just has a static ip of 192.168.0.100. It did not get it's address from a router.

Does that make a difference?
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12008
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Accessing device with different subnet

Sun Jan 29, 2017 7:15 am

There are not 2 routers...

There is one router with the lan set to 192.168.47.0/24.

The device just has a static ip of 192.168.0.100. It did not get it's address from a router.

Does that make a difference?
I fix the post, re-read it
 
tabate47
Long time Member
Long time Member
Topic Author
Posts: 510
Joined: Wed Mar 13, 2013 5:23 am
Location: Los Angeles

Re: Accessing device with different subnet

Sun Jan 29, 2017 7:20 am

I could swear I have done this before by using static routing and the firewall.

Is that possible or am I dreaming?
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12008
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Accessing device with different subnet

Sun Jan 29, 2017 7:23 am

I could swear I have done this before by using static routing and the firewall.

Is that possible or am I dreaming?
...is another way... but can be more complicated....
 
tabate47
Long time Member
Long time Member
Topic Author
Posts: 510
Joined: Wed Mar 13, 2013 5:23 am
Location: Los Angeles

Re: Accessing device with different subnet

Sun Jan 29, 2017 7:26 am

can you explain the other way too? I know I've done it but I can't remember how. It involved a static route and some firewall rules.

where does this go: and only if is needed: add src-nat dst-add 192.168.0.100 action src-add to address 192.168.0.101

Thanks
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12008
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Accessing device with different subnet

Sun Jan 29, 2017 7:31 am

can you explain the other way too? I know I've done it but I can't remember how. It involved a static route and some firewall rules.

where does this go: and only if is needed: add src-nat dst-add 192.168.0.100 action src-add to address 192.168.0.101

Thanks
on firewall/nat with the other 2

the other way without IP address on router and the 2 NAT rule are:
add route for 192.168.0.0/24 network, put inside the device the gateway 192.168.0.101, but on this way the device do not to go over internet and you must add some firewall rules to do that and use the proxy-arp feature as last measure.
 
tabate47
Long time Member
Long time Member
Topic Author
Posts: 510
Joined: Wed Mar 13, 2013 5:23 am
Location: Los Angeles

Re: Accessing device with different subnet

Sun Jan 29, 2017 7:41 am

You are very smart! You helped me figure it out. Thank you.

We don't need the mangle rules. The key is adding the address to the address list. It automatically adds the static route.

You also have to add in the filter rules an action accept, fwd chain, dst address 192.168.0.0/24, out interface to the lan.

I'm very happy! Thank you very much.

Who is online

Users browsing this forum: bcmdevtl, DeLL, dervomsee, dvdlss, Google [Bot], GoogleOther [Bot], sstefanov, wispmikrotik and 129 guests