0

I've a service running on Amazon AWS which has restriction on inbound connections to my office machine IP address which are like 10.x.x.x

When I'm at home, I connect to VPN and my IP address when I do hostname -i is 192.168.x.x

I've a service running on machine which sends a message to AWS. When I run the service at home, it sends IP as 192.168.x.x. Is there a way I could change the IP address of my machine as 10.x.x.x. I'm running Windows 7. I can setup Virtual Box if this is possible. I'm thinking I should be able to assign IP address of choice for machine running in VirtualBox and run my service inside it.

1

You can set up a virtual machine and give it (almost) whatever IP address you want, but it won't help you at all.

10.x.x.x and 192.168.x.x are both ranges of private addresses. These addresses are only used inside an organization, they are not routed on the Internet.

Amazon doesn't see your work machine as 10.x.x.x, it sees it as coming from some gateway machine that sits between your work machine and the Internet. The gateway machine performs NAT to enable the work machine with a private address to talk with the outside world — without a public address, a machine cannot talk directly to the outside world.

If you try to connect directly to the Amazon machine from home, you connection will appear as coming from an address that belongs to your ISP at home. If you use the VPN, your connection will appear to come from the Internet gateway for that VPN. In typical corporate VPN setups, that would be the same gateway as when you are at work. If you can connect to Amazon from work but not when logged into your corporate VPN, then it's due to something in your work's network setup — presumably there's a policy that forbids this.

If you can't get the policy changed, you may be able to use another work machine as a relay. Let's say the Amazon machine's address is 203.0.113.65, that you can log in to a machine 10.1.2.3 in your corporate environment over SSH, and that this machine is allowed to talk to the Amazon machine. You can make 10.1.2.3 relay your connection to the Amazon machine from your laptop at home:

ssh -L 1234:203.0.113.65:1234 10.1.2.3

Then tell your software on your laptop to connect to localhost:1234. The ssh client will relay the connection to 10.1.2.3 which will in turn relay it to 203.0.113.65.

  • Relay sounds promising. I've a dev machine at work which can talk to Amazon. It might work, I'll try that and post results. On sider note, the error response from amazon in my application logs shows username@<ip_addr> is not authorized ..<someblah>.. The ip_addr I see in log is 192.168.x.x which is the IP I get when I do hostname -i. I don't see the gateway IP in log i.e., the one I see when I do findmyip in browser. So I'm assuming they have configured on AWS to accept connections from 10.x.x.x instead of the company Gateway IP. – TechCrunch Jan 7 '15 at 2:45
  • Snippet from logs: INFO [2015-01-07 02:39:14,980] com.company.package.types.FailoverProxyFactoryBean: C3PO BEAN com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 2, acquireRetryAttempts -> 2, acquireRetryDelay -> 20, autoCommitOnClose -> false, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, jdbcUrl -> jdbc:mysql://company-dev.us-west-2.rds.amazonaws.com:3306/myschema, lastAcquisitionFailureDefaultUser -> java.sql.SQLException: Access denied for user 'myusername'@'192.168.129.194' (using password: YES),..<and more> – TechCrunch Jan 7 '15 at 2:47
  • @TechCrunch If the Amazon machine is reporting a private address then your company has established a VPN with it, and accessing it is a matter of what restrictions or configuration your company has set up. The normal way to get access would be to contact your company's system administrator (either the one in charge of the home-to-company VPN or the one in charge of the Amazon-hosted service). – Gilles 'SO- stop being evil' Jan 7 '15 at 9:39
-1

Virtualbox has a built-in DHCPserver, you have to disable it, and you have to statically assign address to your guest:

#!/bin/sh
VBoxManage hostonlyif ipconfig vboxnet0 --ip 192.168.1.5 --netmask 255.255.0.0
VBoxManage dhcpserver remove --ifname vboxnet0
VBoxManage dhcpserver remove --ifname vboxnet1

If i don't make mistake, you have to run twice, once by your user, then by root.

  • In my case VirtualBox server / gateway may have address like 192.168.x.x but my virtual machine will have address like 10.x.x.x. Will it work this way ? Like machine and gateway on different subnet ? Sorry if I'm not using right terminology, I'm poor in networking. – TechCrunch Jan 6 '15 at 3:15
  • You have to route in your routing table of host. – PersianGulf Jan 6 '15 at 19:28
-1

In office you can't change ip addr bcoz switch will be configure to work in 10.X.x.x range.

But u can install virtual box in ur system and assign any static ip. it can done while installing os or after installation.

Incase u choose to assign static ip during installation, go to network adapter setting to enter the static ip. or Incase of after installation, edit in /etc/network/interface(ubuntu) or /etc/init.d/network/ifcfg-ethX(redhat) based upon ur os distribution.

You can edit for static ip of ur choice.

  • Will I be able to use internet after assigning static IP ? Because I need to communicate with AWS after assigning this IP. – TechCrunch Jan 6 '15 at 13:19
  • @TechCrunch No. You can use whatever IP address you like on your VM-to-host network, but you won't be able to make Amazon think you have a different IP address from what you have. – Gilles 'SO- stop being evil' Jan 6 '15 at 22:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.