13

As you know I use vagrant to manage one vm, when I login to the vm using vagrant ssh, the output shown that I was login from 10.0.2.2. So this IP was my host's IP . But why can not I see it with running ifconfig in my host? That confused me. (But I can found a record about 10.0.2.2 in the host route table)

Any clue will be appreciated!

pnuts
  • 58,317
  • 11
  • 87
  • 139
Vincentge
  • 885
  • 2
  • 8
  • 10

1 Answers1

19

10.0.2.2 always points to the local host when you are running emulator or vm. So in virtual machine , it refers to the local host (127.0.0.1) as 10.0.2.2. That is the reason you can't see it in ifconfig in your host.
You can find more info in this thread.

Community
  • 1
  • 1
Ahmed
  • 2,176
  • 5
  • 26
  • 40