Comments (7)
Can you please supply the command that was run and the full error output?
from autovpn.
I'm running the python script directly, so it's the standard command, but the output (there are no errors) is just None
.
from autovpn.
I had to modify the pyscript because of the VPC thing.
import time
import boto
import boto.ec2
import sys
keyname=sys.argv[1]
instance_type=sys.argv[2]
region=sys.argv[3]
ami=sys.argv[4]
port=sys.argv[5]
if region:
conn_region = boto.ec2.connect_to_region(region)
else:
conn_region = boto.connect_ec2()
def auto_vpn(ami=ami,
instance_type=instance_type,
key_name=keyname,
group_name="vpn-server",
ssh_port="22",
vpn_port=port,
cidr="0.0.0.0/0",
tag="vpn-server",
user_data=None):
ec2 = conn_region
try:
f = {'group-name':group_name,'vpc-id':'vpc-11111111'}
group = ec2.get_all_security_groups(filters=f)[0]
except ec2.ResponseError, e:
if e.code == 'InvalidGroup.NotFound':
group = ec2.create_security_group(group_name,
'A group that allows VPN access',
vpc_id='vpc-11111111')
group.authorize('tcp',ssh_port,ssh_port,cidr)
group.authorize('udp',vpn_port,vpn_port,cidr)
else:
str('haller')
raise
if int(port) != int(1194):
try:
mgroup = ec2.get_all_security_groups(groupnames=[group_name])[0]
mgroup.authorize('udp',vpn_port,vpn_port,cidr)
except ec2.ResponseError, e:
if e.code == 'InvalidPermission.Duplicate':
'''fail here'''
else:
raise
reservation = ec2.run_instances(ami,
key_name=key_name,
security_group_ids=['sg-11111111'],
instance_type=instance_type,
user_data=user_data,
subnet_id='subnet-11111111')
instance = reservation.instances[0]
while instance.state != 'running':
time.sleep(30)
instance.update()
instance.add_tag(tag)
global host
host = instance.ip_address
print "%s" % host
if __name__ == "__main__":
auto_vpn()
from autovpn.
Actually, after checking my AWS console, I don't see that it got assigned IP addresses (public or private).
from autovpn.
Okay, so I fixed that issue, but now the issue is the ssh-keyscan keeps returning 1 even though the instance is already running and when I run ssh-keyscan manually, after the instance is running, it is returning 0.
from autovpn.
I haven't seen that issue before. are you sure the ssh-keyscan is checking the correct ip address?
from autovpn.
@ttlequals0 I figured this one out, it was because I didn't have an Internet Gateway.
from autovpn.
Related Issues (20)
- key already exist in aws
- error code 5 HOT 6
- custom port 443 with -p flag and issue connecting to vpn HOT 2
- Error code 4 HOT 3
- Error code 5 HOT 5
- Documentation should indicate '[default]' header for AWS credentials, not '[Credentials'] HOT 2
- no internet HOT 5
- VPCIdNotSpecified</Code><Message>No
- How to specify VPC id? HOT 1
- UnauthorizedOperation when running autovpn HOT 6
- autovpn -T -r us-east-1 does not shut down the instance HOT 2
- Chrome reports DNS_PROBE_FINISHED_BAD_CONFIG when openvpn is run HOT 6
- Bidirectional network access (ec2 <-> on-premises) HOT 2
- what packages do you have installed for this to work HOT 1
- Can't get this working HOT 1
- vpn to ec2 instances in a different peered vpc on the same region on the same aws account HOT 2
- Port to Python 3 HOT 1
- idea : add option to associate elastic ip
- . HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autovpn.