how to reboot modem to change your ip using task scheduler? - ip

i need to call a web service but it records user ip as you send request.. so you can't call it twice since your ip is stored... i need to change my ip lets say every 5 minutes.. then 7th minute i need to call that service again..
i want to use task scheduler and batch files to do so, but i don't know how to restart my modem to let it disconnect/reconnect to my ADSL service provider.
any help will be much appreciated

Usually the ADSL provider is not going to give you a new IP every time you restart the modem, and I doubt there is a way to force it. Usually your IP address is saved with the MAC address in the DHCP table for a given amount of time (depending on the routing settings that the ISP has setup).
If you're using a Linux box you can use IP Masquerade http://tldp.org/HOWTO/IP-Masquerade-HOWTO/
You could also use a proxy server.

Related

Will DHCP server give me always same IP?

I have question on DHCP server in home router. I have founded, that I have same IP address in my notebook for some time. I don't know, how long it last, but it is probably few weeks at least. Will DHCP server ever change my local IP if i will still connecting to that Wi-Fi?
I am asking, because I am working on home automation system and I don't know if i had to keep care about checking if my devices has same IP...Because there will be server, which will remember IP of its clients (lets say ESP8266 modules). Must I periodically check IP address (in my modules) and send new IP to server (in case of change)? Or DHCP server will not change IP address of my modules, connected to that DHCP server? And what about situation when ESP8266 module will disconnect (lets say it will be off for few days) - is it common to get different or same IP from DHCP after connection again?
Thanks!
Simple solution would be reserving IP address for your ESP8266 modules in your DHCP server that they always receive the same IPs.
With regards to your questions:
My routers DHCP server saves clients and keep information about them unless it is deleted explicitly or number of saved clients gets larger than number of addresses available. It serves always the same IP to saved clients. Obviously it depends on the router and might be different in your case.
I'd not check for IPs manually, I'd rather reserve the IPs for the modules as said above.
If your DHCP server stores client information it will give the same IPs to your modules upon reconnect. Otherwise not it won't be necessary the case.
If you use or consider using MQTT server (my preferred way :) ) for your home automation (it has integration in many systems like e.g. Home Assistant) you won't need to care about IP addresses of your modules at all you'd only need to fix IP of the MQTT server.
Another option can be addressing your modules (or/and server) using host name instead of IPs. If you develop n Arduino this GitHub thread might be helpful.

Losing Synergy connection to server with VPN

I'm using a Cisco client to connect to a VPN but also using Synergy (Symless) to connect to the machine. It works fine initially but will drop out after machine sleep (or sometimes seemingly randomly), then I have to restart the VPN connection. Not the end of the world, but it is irritating.
Are there any config changes I can do to Networks settings, VPN or Synergy to stop this dropping out?
Found this which I hope will fix it.
https://blog.lan-tech.ca/2013/02/21/access-local-and-vpn-network-simultaneously/
"you just need to add the local devices to the windows routing tables so that it knows to access them when the VPN is active.
See the windows “route” command – E.G. route -p add MASK 255.0.0.0 METRIC IF
To help discover what you need to use, disconnect from your VPN, make sure you can connect to your local device, then run a “route print” show the current active routes and find your device. (generally in the IPv4 Route Table)
It will also list the ‘Metric’ to use, and at the top of the listing is the “Interface List” which lists the network interfaces on your system. You’ll need to figure out which one to use. For example, I know my system has a gigabit network adapter and in the list I see a “Intel(R) Gigabit Network Connection” – bingo – that’s it. The first column is the interface id, 49 in my case.
The “-p” option makes your configuration persistent – meaning that it will be there again next time you boot.
SO, as an example, let’s say I want a local network share at 192.168.1.43 to be accessible to my machine while connected to the VPN, so I would add the route like so:
route -p add 192.168.1.43 MASK 255.0.0.0 192.168.1.1 METRIC 15 IF 49
Now if I run route print, I see this new route in the list of persistent routes for IPv4.
I turn my VPN back on, and instead of the device ‘disappearing’ as it normally does, windows can still find it because it is in the persistent route list."

Remote login to linux system, ip unkown

I will be physically sending a Linux netbook to a remote site where it will be connected to the internet. I have no idea of the public IP address.
I need to be able to securely log in to the system. What's the best way to do this? I guess it needs to broadcast an id somehow (dyndns? free options?). It all needs to be preconfigured before I send it.
I'm more than happy to research on my own, but I'd be grateful in someone could point me in the right direction.
Regards,
Update- I only need console access, and it's ubuntu
Because the system may be behind an NAT or firewall, there is no way you can guarantee any connectivity. Even if you did know its public IP address, it is unlikely that you would be able to initiate a connection to the box from the outside.
So the next best thing is to have the box itself initiate a connection to one or more known servers. An outgoing connection stands a much better chance of traversing any firewalls and is essential to traversing NAT.
To make this work, you will need a server with some process listening for connections on a fixed address and port and ready to forward your ssh sessions to any such connection. The box itself will need to periodically attempt an outgoing connection to that server, perhaps hourly.
The simplest would be to have an /etc/rc.init script (or whatever is the equivalent on your particular linux distribution) which periodically tries to establish an ssh tunnel. It might look something like:
ssh -i remotekey.pem -R 33333:localhost:22 user#my.server.com
This assumes you've setup "user" for key based login using "remotekey.pem" on your server.
Then from your server you would log into the remote box using
ssh -p 33333 boxuser#localhost
This assumes "boxuser" is a valid user on your remote box.

How do I monitor network connections to see what address a certain program is contacting

I made a program many years ago, that connects to a SQL Server database (port 1433), and I no longer have the code for this application, but I need to know whether it is trying to connected to the domain name exampleDomain.com or if it is connecting directly to the IP address, xxx.xxx.xxx.xxx.
I need to find this out because I want to switch hosting providers, but cannot let this application stop working, so I'm not sure if changing the IP Address of the SQL server will affect the program.
Is there a way I can tell what this program is connecting to? The raw IP Address or the domain Name?
thanks.
Use wireshark. http://www.wireshark.org/
It's free, easy to use, and very powerful.
You can monitor all traffic coming out of your PC and you can filter the traffic by type. So first I would look for any DNS communication that has MyDoman.com and then look at TCP connections.

EC2 instances not responding to internal ping

I did a script that launch several amazon instances with the same security group which is the default one, with ICMP and all the TCP/UDP connection allowed... so no firewall problem.
I am running an ubuntu 11.4 64 bits ami working fine.
Usually in the bunch of machine I launch some do not respond to any ping or telnet connection. They can ping other machines but cannot be pinged. The other machines can ping each other in two directions without any problem, but usually one or two just don't respond to any ping. There is no difference in the way I launch them, so I don't understand where this bug comes from...
How to avoid this problem and recover from it without restarting the EC2 instance?
Thanks a lot tender developpers :D.
try this
Log into AWS account.
Click on Security Groups. Choose the required security group.
Click on the Inbound tab.
Create a new rule:
Custom ICMP rule
Type: Echo request
Source: 0.0.0.0/0
0.0.0.0 will allow everyone to ping your server. You can specify your own addresses if you want.
Assuming all the instances you launch have the same security group and same ami, you need to contact amazon about this.
https://forums.aws.amazon.com/thread.jspa?threadID=22640

Resources