Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why "10.0.2.2" was not there with running "ifconfig"?

Tags:

vagrant

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!

like image 978
Vincentge Avatar asked Nov 18 '15 10:11

Vincentge


1 Answers

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.

like image 189
Ahmed Avatar answered Nov 16 '22 03:11

Ahmed