Page 1 of 1

Dynamic IP script to update something

Posted: Mon Jul 16, 2012 11:18 pm
by Ehman
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

Re: Dynamic IP script to update something

Posted: Mon Jul 16, 2012 11:26 pm
by samsung172
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.

Re: Dynamic IP script to update something

Posted: Mon Jul 16, 2012 11:39 pm
by Ehman
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...

Re: Dynamic IP script to update something

Posted: Mon Jul 16, 2012 11:51 pm
by samsung172
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

Re: Dynamic IP script to update something

Posted: Tue Jul 17, 2012 12:09 am
by Ehman
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

Re: Dynamic IP script to update something

Posted: Tue Jul 17, 2012 12:25 am
by samsung172
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.

Re: Dynamic IP script to update something

Posted: Tue Jul 17, 2012 12:34 am
by Ehman
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

Re: Dynamic IP script to update something

Posted: Tue Jul 17, 2012 12:47 am
by samsung172
Then its not that easy. I would try to put a terminator in the middle. connecting both sides to it.

Re: Dynamic IP script to update something

Posted: Tue Jul 17, 2012 12:52 am
by Ehman
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?

Re: Dynamic IP script to update something

Posted: Tue Jul 17, 2012 1:31 am
by samsung172
yep

Re: Dynamic IP script to update something

Posted: Tue Jul 17, 2012 1:38 am
by Ehman
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

Re: Dynamic IP script to update something

Posted: Tue Jul 17, 2012 7:04 am
by omega-00
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.

Dynamic IP script to update something

Posted: Tue Jul 17, 2012 8:19 am
by jhheider
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.

Re: Dynamic IP script to update something

Posted: Tue Jul 17, 2012 10:29 am
by Ehman
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

Re: Dynamic IP script to update something

Posted: Wed Jul 18, 2012 12:45 am
by samsung172
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.

Re: Dynamic IP script to update something

Posted: Wed Jul 18, 2012 12:51 am
by Ehman
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?

Re: Dynamic IP script to update something

Posted: Wed Jul 18, 2012 2:26 am
by Ehman
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.

Re: Dynamic IP script to update something

Posted: Fri Jul 20, 2012 2:06 am
by Ehman
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?