Community discussions

MUM Europe 2020
 
Ehman
Member
Member
Topic Author
Posts: 363
Joined: Mon Nov 15, 2010 10:49 pm

Dynamic IP script to update something

Mon Jul 16, 2012 11:18 pm

Hi Folks

Here is something I really wanna do:

Ive got a client routerboard dialing to the server routerboard (pptp) with a dynamic IP, it keeps changing every 24hours, so I need a method to update the client routerboard, so that everything will be running forever, but I wanna do this all without using any of the dynamic IP services out there, I need my own dedicated service, to give me the peace of mind that it will work forever and to have more control.

I would appreciate any help
thx
 
samsung172
Forum Guru
Forum Guru
Posts: 1186
Joined: Sat Apr 04, 2009 3:45 am
Location: Østfold - Norway
Contact:

Re: Dynamic IP script to update something

Mon Jul 16, 2012 11:26 pm

run an l2tp client (server at the other end) for managment, and connect to this. Then you'll get an managment ip, regardless of the dynamic ip provided.
 
Ehman
Member
Member
Topic Author
Posts: 363
Joined: Mon Nov 15, 2010 10:49 pm

Re: Dynamic IP script to update something

Mon Jul 16, 2012 11:39 pm

run an l2tp client (server at the other end) for managment, and connect to this. Then you'll get an managment ip, regardless of the dynamic ip provided.
dammm I'm so confused now...
 
samsung172
Forum Guru
Forum Guru
Posts: 1186
Joined: Sat Apr 04, 2009 3:45 am
Location: Østfold - Norway
Contact:

Re: Dynamic IP script to update something

Mon Jul 16, 2012 11:51 pm

make an managment net (eg 10.10.10.0/24) ((add an bridge interface and call it loopcack. add ip 10.10.10.1/24 to the interface) Dont add anny ports.

Setup an l2tp serverm and add a profile.


/ppp profile
    add change-tcp-mss=no name=l2tp only-one=no remote-ipv6-prefix-pool=none \
    use-compression=no use-encryption=required use-ipv6=yes use-mpls=default \
    use-vj-compression=no
add user to the server


/ppp secret
add caller-id="" disabled=no limit-bytes-in=0 limit-bytes-out=0 local-address=10.10.10.1 name=something password=something profile=l2tp remote-address=10.10.10.2 routes="" service=l2tp

and "enable" the server

/interface l2tp-server server
set authentication=mschap2 default-profile=l2tp enabled=yes max-mru=1280 max-mtu=1280 mrru=disabled


then add an l2tp client, connecting to your main router's ip, with your user and password. (also add the profile here)

then you should be able to ping 10.10.10.2 and access it from 10.10.10.1
 
Ehman
Member
Member
Topic Author
Posts: 363
Joined: Mon Nov 15, 2010 10:49 pm

Re: Dynamic IP script to update something

Tue Jul 17, 2012 12:09 am

mkay, so you want me that add that ontop of the current system thats already configured as a pptp client board that connects to the pptp server board with dynamic IP?



EDIT: dont forget, the 2 connects via internet
 
samsung172
Forum Guru
Forum Guru
Posts: 1186
Joined: Sat Apr 04, 2009 3:45 am
Location: Østfold - Norway
Contact:

Re: Dynamic IP script to update something

Tue Jul 17, 2012 12:25 am

I assumed that one of them did not change IP. in that case, make an terminator, with same configuration, have a device with a non switching IP. :)


its also possible using some kind of dynamic dns provider, and make a script that will return IP from dns. but still may be dissconnects. Its not easy to maintain a datastream if both devices always change ip.
 
Ehman
Member
Member
Topic Author
Posts: 363
Joined: Mon Nov 15, 2010 10:49 pm

Re: Dynamic IP script to update something

Tue Jul 17, 2012 12:34 am

I assumed that one of them did not change IP. in that case, make an terminator, with same configuration, have a device with a non switching IP. :)


its also possible using some kind of dynamic dns provider, and make a script that will return IP from dns. but still may be dissconnects. Its not easy to maintain a datastream if both devices always change ip.
hectic, yea.. im going to first try out your first method

my setup is: the server router board is on a ADSL with a dynamic IP, and the client is on a 3G connection, mobile internet, and the IP of this network is private, and not accessible, and shared among 10000000000+ users, no joke.

EDIT: its probably NAT'ed 30 times also to
 
samsung172
Forum Guru
Forum Guru
Posts: 1186
Joined: Sat Apr 04, 2009 3:45 am
Location: Østfold - Norway
Contact:

Re: Dynamic IP script to update something

Tue Jul 17, 2012 12:47 am

Then its not that easy. I would try to put a terminator in the middle. connecting both sides to it.
 
Ehman
Member
Member
Topic Author
Posts: 363
Joined: Mon Nov 15, 2010 10:49 pm

Re: Dynamic IP script to update something

Tue Jul 17, 2012 12:52 am

Then its not that easy. I would try to put a terminator in the middle. connecting both sides to it.
and by terminator you mean: a tunnel server in the middle and let the 2 boys connect to it?
 
samsung172
Forum Guru
Forum Guru
Posts: 1186
Joined: Sat Apr 04, 2009 3:45 am
Location: Østfold - Norway
Contact:

Re: Dynamic IP script to update something

Tue Jul 17, 2012 1:31 am

yep
 
Ehman
Member
Member
Topic Author
Posts: 363
Joined: Mon Nov 15, 2010 10:49 pm

Re: Dynamic IP script to update something

Tue Jul 17, 2012 1:38 am

yep
well, thats the best idea ever, but.. the problem is, both clients will have to get updated once the server IP changed, and the server will just be a mirror for data, and thats going to be super slow and expensive if you add alot of clients later on.

and I really dont trust the dynamic dns/ip boys, because imagine this, one day, that company closed or goes offline for a long time and then you might have 200 clients configured to use their service, hahahah woow hectic times then
 
User avatar
omega-00
Forum Guru
Forum Guru
Posts: 1167
Joined: Sat Jun 06, 2009 4:54 am
Location: Australia
Contact:

Re: Dynamic IP script to update something

Tue Jul 17, 2012 7:04 am

yep
well, thats the best idea ever, but.. the problem is, both clients will have to get updated once the server IP changed, and the server will just be a mirror for data, and thats going to be super slow and expensive if you add alot of clients later on.

and I really dont trust the dynamic dns/ip boys, because imagine this, one day, that company closed or goes offline for a long time and then you might have 200 clients configured to use their service, hahahah woow hectic times then
If you're concerned about using a 3rd party that's been around for years, the alternative is to fork out $250 and run the dynamic DNS server yourself!
http://www.dyndnsservices.com/

I'm sure there are probably some open source options to but this was the first one I found with support for any device that works with DynDNS.
brightwifi.com | mikrotik-routeros.com | MTCNA,MTCWE.MTCTCE | Give karma where due
 
User avatar
jhheider
newbie
Posts: 48
Joined: Fri Sep 30, 2011 5:04 pm

Dynamic IP script to update something

Tue Jul 17, 2012 8:19 am

It's completely trivial to write a script that uploads just the ip to a web server of your choosing. Then have the server make whatever changes you need using API/ssh/whatever.
 
Ehman
Member
Member
Topic Author
Posts: 363
Joined: Mon Nov 15, 2010 10:49 pm

Re: Dynamic IP script to update something

Tue Jul 17, 2012 10:29 am

If you're concerned about using a 3rd party that's been around for years, the alternative is to fork out $250 and run the dynamic DNS server yourself!
http://www.dyndnsservices.com/

I'm sure there are probably some open source options to but this was the first one I found with support for any device that works with DynDNS.
I'm using No-Ip, works good for me, but still

It's completely trivial to write a script that uploads just the ip to a web server of your choosing. Then have the server make whatever changes you need using API/ssh/whatever.
thats something I'm keen to have :D ...the routerboard can even email its new IP to a mail server lol.. (oh wait, my emails get lost sometimes) :?
...but I think the best option would be to make the router upload its new IP on some SQL database with its unique "client code" or even excel file, lol, and access it via FTP

But I've got a lot of idea's and 0% knowledge of scripting
 
samsung172
Forum Guru
Forum Guru
Posts: 1186
Joined: Sat Apr 04, 2009 3:45 am
Location: Østfold - Norway
Contact:

Re: Dynamic IP script to update something

Wed Jul 18, 2012 12:45 am

If you want to have an easy "advanced" sulution. Just make a script connecting sheduled to an ftp, that holds another script, download, and run this.
 
Ehman
Member
Member
Topic Author
Posts: 363
Joined: Mon Nov 15, 2010 10:49 pm

Re: Dynamic IP script to update something

Wed Jul 18, 2012 12:51 am

If you want to have an easy "advanced" sulution. Just make a script connecting sheduled to an ftp, that holds another script, download, and run this.
Dammmm, that can come in handy for switching 300 NAS devices over to a new system IP or something


that holds another script, download, and run this.
but whats so usefull about this option in normal life?
 
Ehman
Member
Member
Topic Author
Posts: 363
Joined: Mon Nov 15, 2010 10:49 pm

Re: Dynamic IP script to update something

Wed Jul 18, 2012 2:26 am

OK! folks, I've got a idea, for a ghetto dynamic IP setup, but no dns involved

the server routerboard, checks it IP on for example :ether1 ..god only knows how, tracert? and when it detected a change of IP, it uploads the IP address to a ftp server to some file thingy
everyone have access to a ftp server, if you have a website, I have 2 websites running for years and 1 VPS (thats about to expire)

the client routerboard, connects to the ftp site, and reads the file thingy to see if its necessary to change the IP address of the field, say for example, radius server to connect to field


Will it be difficult to do it? I'm just super curious because I love messing around with this systems, but cant write script to save my life.
 
Ehman
Member
Member
Topic Author
Posts: 363
Joined: Mon Nov 15, 2010 10:49 pm

Re: Dynamic IP script to update something

Fri Jul 20, 2012 2:06 am

can anyone help me out with this script or maybe tell me how to make script?

are there like a application that can help to make scripts out there?

Who is online

Users browsing this forum: No registered users and 10 guests