I'm running Kali Linux in VMware, and its IP address is 127.0.0.1 and my PC IP address is 192.168.1.5, and I can still ping my Kali Linux with my PC, shouldn't both of their IPs start with 192.168... in order to communicate with each other?
3 Answers
127.0.0.1 is the loopback address on lo or similar and should exist on all systems.
You can infact ping any address in 127.0.0.0/8 with the exception of 127.0.0.0 & 127.255.255.255.
- 1,358
-
The person who asked might want to have a look at localhost and private network at the very least. – Seth Nov 23 '21 at 12:55
127.0.0.1 is standard shorthand for "me".
It's known as the loopback address, or localhost. Every computer's 'self' can be reached at 127.0.0.1.
In computer networking, localhost is a hostname that refers to the current device used to access it. It is used to access the network services that are running on the host via the loopback network interface. Using the loopback interface bypasses any local network interface hardware.
- 49,589
127.0.0.1is a loopback address, assigned to special loopback interface namedloand associated with the namelocalhost. This is the way to express literal "Here" for a computer. Continuing the analogy, the localhost name corresponds to "Myself", FQDN corresponds to to a full name, the hostname corresponds to a first name, and the "non-loopback" IP addresses correspond to the current position of the person inside the room, while network addresses are like room numbers.No, IP addresses don't have to be in the same network to be able to communicate. For instance, your PC is not in the same network as SuperUser server, but those are communicating somehow. In Linux, you can in principle bind a socket to any address assigned to the computer (all of them are called local addresses and you can observe them in the
localrouting table withip route show table local) and communicate with any entity which has that address routed towards your computer. In particular, any two addresses present in the local table can communicate with each other, because the local table is the source of information "what's me" for a computer.
- 2,780
127.0.0.1from anything but your Kali you are not pinging your Kali. – Kamil Maciorowski Nov 23 '21 at 13:07ifconfigin Kali, it only shows 127.0.0.1 as the IP, so it's not its actual IP in this LAN? I remember I had used kali in VMware a long time ago, and both my PC and my Kali IP addresses were starting with 192.168..., but now it's like this, how can I get Kali's private IP address then? – bzmind Nov 23 '21 at 13:10lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536inet 127.0.0.1 netmask 255.0.0.0this is what it outputs, is it the correct ip? there's no other IP addresses in the output – bzmind Nov 23 '21 at 13:17127.0.0.1is the correct address for thelo(loopback) interface. To communicate with the outside world you need another network interface. If there is no other interface then it means the hypervisor does not emulate an interface for the VM, or the OS in the VM (Kali in your case) cannot "talk" to this "hardware" for some reason. But to tell if there is another interface, you needifconfig -a, not onlyifconfig. – Kamil Maciorowski Nov 23 '21 at 13:24ifconfig -aand this time it also shows eth0, but it doesn't have any IP I guess, here's the output:eth0: flags=4098<BROADCAST,MULTICAST> mtu 1500ether 00:0c:29:1c:ab:a2 txqueuelen 1000 (Ethernet)– bzmind Nov 23 '21 at 13:27127.0.0.1, solved. Ask a new question about your current problem if you want. About "I'm totally a noob in networking and Linux in general": please read this question. It may save you nerves. – Kamil Maciorowski Nov 23 '21 at 13:33