Possible to assign a new IP address on every http

2019-06-16 11:23发布

问题:

Is it possible for me to change or assign my server a new IP address every time it needs to make a http request with commands such as wget?

Thanks all

Update

The reason for this is exactly what the Tor project is trying to achieve. I do not want to leave a trace of what requests my server makes and I thought constantly changing my IP address could help me and my users use the internet without being followed around. :)

回答1:

If you have a large pool of proxies you can use, then I suppose you could switch between them, but otherwise no, you generally can't just renew your IP address whenever you feel like it.

You might want to look into Tor, an anonymizing network which does something like what you're asking about.



回答2:

If feel that people who ask questions like this one that are borderline unethical, should provide an explanation for how they intend to use the information provided in the responses in an ethical fashion.

If you have a large pool of IP addresses at your disposal, you may be able to switch between them. This is the reason, however, why there are bot networks out there - because criminals can't really hide their own IP addresses, so they have to use other people's.



回答3:

If you have multiple IP numbers already assigned to your machine, you can pass an argument to wget as follows:

wget --bind-address=364.293.991.800 http://address.you.are.secretly.visiting/

However, if you have multiple IP numbers assigned they will all be from the same pool of IPs provided by your ISP. I don't think this is what you mean - it sounds like you want to use random different addresses from different pools so that you can't be traced. You will need to use remote proxies for this, so something like Tor is the right suggestion.

You might want to clarify the question a bit, though: do you want to hide yourself from the websites you are accessing, or from your own ISP, or from someone who is potentially monitoring your web traffic?

If it's the websites, Tor or other proxying services are the answer. If it's your ISP, don't bother. And if you are not in China the latter is unlikely to be an issue, unless you're paranoid. I know some people who are worried about this kind of thing, but I think they're nuts.



回答4:

The first question to ask is, how would you change the IP address of your server once? In general, you will need the cooperation of your ISP, and even then, they will only have a limited size pool of IP addresses to offer you.

Changing the IP address of your server while it's up will cause any existing connections to eventually fail (because packets from the remote server won't find their own way back to your server, which just moved). So, you would need to set up multiple IP addresses on your server simultaneously, which is possible but again requires the cooperation of your ISP. There will also be a practical limit of how many IP addresses you can assign to your single computer.

The advantage of something like Tor is that requests might come from anywhere in the world. IP addresses are divided up by country and then allocated to ISPs, so there would be no way for your ISP to give you an IP address in the range assigned to Germany, for example (assuming you're not in Germany to begin with).