Community discussions

MikroTik App
 
ramirez
Member Candidate
Member Candidate
Topic Author
Posts: 148
Joined: Sun May 12, 2013 9:48 pm

IP/cloud getting different public address.

Wed Mar 06, 2024 2:08 pm

At a remote location (B) where no physical access is possible a MT client is connecting via L2TP to a server at another location (C). Access is only possible to MT client and MT Server FROM LOCATION (A).

When that MT client is sitting behind an ISP modem with CGNAT and ip/cloud getting a different public address than the modem’s, is it possible to have that MT client informed of the modem’s public address? To better phrase it, MT client ==> IP/cloud, reads 190.190.190.5 and a separate device (e.g. a laptop) connected on the modem reads 180.180.180.7 (through https://whatismyipaddress.com/) is it possible to have IP/CLOUD register the second public address?

The reason being with 190.190.190.5 the connection between client and server fails, manually entering on the server side IP/IPsec/peers 180.180.180.7 (instead of xxxxx.sn.mynetname.net) the connection is established. For obvious reasons if 180.180.180.7 changes the connection will fail.

Thank you in advance!
 
holvoetn
Forum Guru
Forum Guru
Posts: 5500
Joined: Tue Apr 13, 2021 2:14 am
Location: Belgium

Re: IP/cloud getting different public address.

Wed Mar 06, 2024 2:26 pm

 
ramirez
Member Candidate
Member Candidate
Topic Author
Posts: 148
Joined: Sun May 12, 2013 9:48 pm

Re: IP/cloud getting different public address.

Wed Mar 06, 2024 3:50 pm

Thank you Holvoetn ! Just a quick question ...which is the "ip.of.wan-x.gw" Sindy refers to /ip route add routing-mark=via-wan-x gateway=ip.of.wan-x.gw ?
 
holvoetn
Forum Guru
Forum Guru
Posts: 5500
Joined: Tue Apr 13, 2021 2:14 am
Location: Belgium

Re: IP/cloud getting different public address.

Wed Mar 06, 2024 4:05 pm

The IP address of your gateway for that ISP which you want to use.
 
ramirez
Member Candidate
Member Candidate
Topic Author
Posts: 148
Joined: Sun May 12, 2013 9:48 pm

Re: IP/cloud getting different public address.

Wed Mar 06, 2024 4:20 pm

You mean the modem's ? 192.168.1.1 ?
 
holvoetn
Forum Guru
Forum Guru
Posts: 5500
Joined: Tue Apr 13, 2021 2:14 am
Location: Belgium

Re: IP/cloud getting different public address.

Wed Mar 06, 2024 4:21 pm

Address of the modem in your case, I would think.
 
ramirez
Member Candidate
Member Candidate
Topic Author
Posts: 148
Joined: Sun May 12, 2013 9:48 pm

Re: IP/cloud getting different public address.

Wed Mar 06, 2024 4:26 pm

Correct, the address of the modem is 192.168.1.1 :(

Did everything per the instructions but still the link fails between the server and the client when I use the xxxxxxx.sn.mynetname.net :?
 
ramirez
Member Candidate
Member Candidate
Topic Author
Posts: 148
Joined: Sun May 12, 2013 9:48 pm

Re: IP/cloud getting different public address.

Thu Mar 07, 2024 9:53 am

I don't know if Sindy's eye will catch this, but I have doubts whether 192.168.1.1 is the correct address to enter :

from the initial post :

"As for determining the IP of the gateway of that WAN, either you don't need the router itself to determine it because it doesn't change (it is a typical case that you have a high-speed WAN with a dynamic or private address so you use it for most of the traffic, and then you have a low-speed one with a fixed public address which you want to use for remote access), or you need a script similar to the one we have recently disussed, to copy the gateway IP to the marked route each time a DHCP assignment is received."

/ip route add routing-mark=via-wan-x gateway=ip.of.wan-x.gw

Also now that it just came to mind...When one doesn't know the setup of the modem at the remote location, I mean whether it has a regular dynamic public address or a CGNAT, would applying the above scenario (Sindy's input) solve either cases? In other words, presetting the client with the solution work and produce a live connection with the Server in either case (regular dynamic address or CGNAT) ?

Who is online

Users browsing this forum: Ahrefs [Bot], gotsprings and 43 guests