16

I want to spoof (not actually change) the public IP that my computer sends to servers. I don't care what it gets changed to as long as it changes, even by one digit. I don't want to have to use a VPN or a proxy, and I want my router to not be involved with this. How do I do this?

If it helps I do have a dynamic IP, however like I said I don't want to change anything in my router every time, I'd be fine doing it once time to set up the system.

Also, I don't want this to only affect my web browsing, I want to have this affect every program that connects to the internet on my computer.

3
  • 3
    This is an XY question. You're much more likely to get useful answers if you ask us about your actual problem rather than about your proposed solution. Presumably you want to spoof your public IP for some reason. And presumably you don't want to use a VPN or proxy for some reason. But you don't tell us what these reasons are, so there's no way we can find an actual solution to your actual problem that meets your actual requirements. Jul 13, 2013 at 23:11
  • 1
    Several problems exist with your request. Say you spoofed your source IP to 1.2.3.4 and your real ip is 100.99.98.97. If the packet goes out as coming from 1.2.3.4 you will never get a response as the destination server will send the packet back to 1.2.3.4. The computer at that IP is not expecting the data so it will just throw it out. Your computer,100.99.98.97, will never get a response so no connection can be established. Furthermore, your ISP may detect the bogus address and discard the packets anyway.
    – cybernard
    Jul 13, 2013 at 23:14
  • Even if you could program your router to release and renew your IP automatically, you would lose all established connection every time it changed. In the middle of a 2gb download, well to bad connection terminated.
    – cybernard
    Jul 13, 2013 at 23:26

2 Answers 2

53

Spoofing your IP address in the manner you are describing is like writing the wrong return address on an envelope and expecting a reply letter to your real address. It isn't going to happen because the only reply information they have is the wrong return address.

There are many Linux tools that will let you create spoofed IP datagrams, and with iptables you can tell a Linux system, acting as a router, to do all sorts of things to traffic, including modifying your source IP to something totally different. Likely your ISP, if it is a residential ISP, is going to automatically filter any traffic coming from your cable or DSL modem where the source IP doesn't match what the ISP gave you via DHCP, or at least within its public subnet. This may prompt your ISP to cut off your service thinking you are infected with malware.

The only way you can "hide" your IP is have another system in front of you that takes your traffic and forwards it on your behalf, i.e., a proxy.

1
  • 11
    Your analogy about the return address was very good, it explained how it worked very well, thanks for this answer.
    – Jon
    Jul 13, 2013 at 23:08
2

This (as far as I'm aware - I'm happy to be proven wrong) isn't possible - at least not in a standard home network with an ISP-provided router and not with the constraints that you've given (no VPN/proxy/router changes).

You can definitely spoof an IP on your home subnet, but this wouldn't affect the SNAT (source NAT) that your router performs - all requests originating from your router will appear to be from its WAN interface.

If you control two static IP addresses, you could set your router to SNAT to that IP (assuming it's approved by your ISP). Something like this in iptables-speak:

iptables -t nat -I POSTROUTING 1 -p all -s 192.168.x.y -j SNAT --to-source 1.2.3.4

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .