11

Can I map 146.112.61.106 IP address to my 127.0.0.1 adress ?

so when I type 146.112.61.106 I got redirected to 127.0.0.1 ? (some netsh command maybe ?)

2

1 Answer 1

16

As you spoke about netsh, I assume that you are working on Windows.

  1. Run cmd.exe as Administrator.
  2. Exec netsh int ip sh int and press "Enter".
  3. Identify your loopback Idx (first column).
  4. Exec netsh int ip add addr <IDX> <IP>/32 st=ac sk=tr and press "Enter". In my case, with IDX=1 I exec: netsh int ip add addr 1 146.112.61.106/32 st=ac sk=tr.
  5. To delete the rule use the command: exec netsh int ip delete addr <IDX> <IP>.

    • st=ac stands for store = active. This means the IP address you are adding to the loopback adapter will automatically disappear upon the next boot of the system. If you need to keep the changes, then change the argument to st=persistent.
    • sk=tr stands for skipassource = true. The man page reads: “skipassource: Do not use the address as source address for any outgoing packet unless explicitly specified. The default value is false.”
    • You can verify that it works by running a sniffer or from command line: tracert -d 146.112.61.106. You must see just one hop.
6
  • 2
    Great. What if I want to rediretct it to another IP: let say 100.100.100.100 ?
    – yarek
    Aug 10, 2015 at 8:53
  • You've already asked on Superuser. Don't cross-post.
    – noitsbecky
    Aug 10, 2015 at 11:24
  • Idem. netsh int ip add addr 1 100.100.100.100/32 st=ac sk=tr Aug 10, 2015 at 14:58
  • 3
    it is the same: it redirects to local host. What I try to achieve is: 146.112.61.106. redirectsTo-> 37.59.14.123 . I mean one external IP to another external IP redirection. Can this be done with netsh command ?
    – yarek
    Aug 10, 2015 at 15:16
  • 1
    @DanielWidrick, sometimes the problem is because the network administrator don't want to work, and we need a solution, ok, it isn't a correct solution for a correct scenario.
    – danilo
    Aug 24, 2019 at 23:10

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