Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help needed: When EC2 instance is stopped and restarted, VPN no longer works #6

Open
wyun opened this issue Jan 12, 2015 · 4 comments

Comments

@wyun
Copy link

wyun commented Jan 12, 2015

Help needed:
When EC2 instance is stopped and restarted, VPN no longer works. The user script is the same, I wonder why restarting a working EC2 instance will not create a working VPN any more....

@sarfata
Copy link
Owner

sarfata commented Jan 12, 2015

The script is only executed once when the machine starts, not when it reboots. There are different reasons why it's not working anymore:

  • Some services might not have started automatically
  • IP address might have changed

In any case, you can just create a new instance instead of re-using the same one. It would cost you the same. Have you tried this?

@wyun
Copy link
Author

wyun commented Jan 12, 2015

Thanks for the quick reply.

I modified the script to include a variable $DYNDNS_URL, then at the end of the script, it will automatically updates the dynamic DNS with the new IP address:
curl -s $DYNDNS_URL

This all works well. So for the second reason, it's usually not an issue for changed IP.

I did try to start new instance, it works well. Just trying to figure out why the same script cannot be restarted.

Thanks.

@sarfata
Copy link
Owner

sarfata commented Jan 12, 2015

@wyun the script is ran only the first time you boot the machine. Not every time. The ip addresses are saved in ipsec.conf and I think your problem is that they are not updated when you start the machine the second time.

@wyun
Copy link
Author

wyun commented Jan 12, 2015

That makes sense. Thank you for the help. I will restart new instances then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants