Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have configured the eth0 in my amazon instance with 2 private ips (primary and additional) and 2 elastic ip each one, so i can access through ssh to my server using the both public ips, but when i try to access to another server using wget o curl the instance always use the elastic ip associated to the primary private ip.

How can i access to internet using the current public ip from i'm connected?

share|improve this question

1 Answer 1

For wget you can use the --bind-address=ADDRESS option, where ADDRESS is the local address you want to use. Curl provides the --interface option where you can provide an interface or address.

The exact option to use depends on the application you are using. Not all applications provide such an option. They can only use the default.

share|improve this answer
    
At the OS API layer, sockets can have the local address bound before use, or not. Other programs and libraries end up using (maybe not directly) this OS API layer. It's all a matter of whether the address is specified or not. If not it will be what the kernel finds first working. Whatever you are using to make the connection, you must use its way of setting this. –  Skaperen Aug 13 '13 at 2:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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