Does pinging 127.0.0.1 work on your machine if it's not on the network?
Can these two machine be on the same network?
machine A (192.168.173.11)
machine B (192.168.163.11)
-
Yes, pinging 127.0.0.1 works if you're not plugged in. Those addresses can be on the same network, but it depends on some other things on whether or not they actually are. They might be on different subnets. What are the subnet masks on the machines?
From squillman -
yes of course, 127.0.0.1 is always available. It is the "localhost", pointing to the machine itself without going to a real net. It is the address of the loopback device and it is present even if no net card is installed (on every modern OS at least).
192.168.x.x is a set of 256 C classes for internal use (see RFC1918) so you can have 65k hosts (as if it would had been a B class). So your machines can stay on the same net and see each others, pay attention to have the right netmask!
If you have a netmask 255.255.0.0 they are on the same net, if you have 255.255.255.0 they don't
Scott Lundberg : 192.168.x.x is not a class B network, it's a class C...AlberT : A C class is a.b.c.X, a B class is a.b.X.XAlberT : http://en.wikipedia.org/wiki/Classful_network#Classesmdpc : I thought that there is now no such thing as network classes. The old style 'B class' networks are being distributed as much smaller subset these days. Network classes are a thing of the past.Scott Lundberg : @AlberT: you are correct if you look at just the subnet mask, but anyone can use a classless subnet mask. If you look further down on the wiki post, you will see that Class C starts at 192.0.0.0 regardless of the subnet mask...TrueDuality : That only defines the reserved range for that block. "Classes" are a way to define which super block a particular subnet belongs to. This is entirely dependent on the netmask in use. 255.0.0.0 is a Class A, 255.255.0.0 is a Class B, and 255.255.255.0 is a Class C. People commonly refer to blocks that they have been assigned in these classes as well even if they have broken them down further.AlberT : I totally agree with @TrueDuality.ktower : @AlberT: Read your own sources. Using the old class mentality, 192.168.x.x is considered Class C space (leading bits of 110), and while a /16 block ("class B") is reserved, RFC 1918 states it is "a set of 256 contiguous class C network numbers".AlberT : @ktower: as far as I can read in RFC1918 it says: 3. Private Address Space The Internet Assigned Numbers Authority (IANA) has reserved the following three blocks of the IP address space for private internets: 10.0.0.0 - 10.255.255.255 (10/8 prefix) 172.16.0.0 - 172.31.255.255 (172.16/12 prefix) 192.168.0.0 - 192.168.255.255 (192.168/16 prefix) Read more: http://www.faqs.org/rfcs/rfc1918.html#ixzz0rBiGVjkwktower : @AlberT: Keep reading into the next paragraph: "third block is a set of 256 contiguous class C network numbers", not a single "class B". There is a difference. /16 != Class B. Read more: http://www.faqs.org/rfcs/rfc1918.html#ixzz0rDTGiaTzAlberT : @ktower I got your point right now. Sorry did not understood what you are referring to, yes of course you are right, 192.168.y.x is technically not a single C class, but a set of "y" (say 256) C classes. Got you point and agreed :)From AlberT -
You can ping 127.0.0.1 if a computer is not connected to a network.
Machine A and B can both be on the same network, as their IPs are different. Assuming a 24-bit subnet mask, they are on different subnets though, so you will need routing between the subnets in order for them to communicate.
bortzmeyer : There is no reason to assume a mask of 24 bits.MarkM : The only way to answer the question as stated is to assume certain things about the setup. Seeing as /24 is the most common it is what I assumed.From MarkM -
Yes, 127.0.0.1 is called loopback network and is always available. This address points to the machine itself.
EDIT: To answer the second part of the question: Yes, machines A and B can be on the same network (but NOT the same as 127.0.0.1, while loopback is virtual) if the netmask is set properly. Use IP calculator to get what you need.
rmeador : IIRC, on some versions of Windows (I think 95), the loopback interface was only available if you had a NIC (or modem, presumably) installed.minder : Yeah, but let's say we don't count ancient systems ;) If he has a network stack installed (required to set machine's IP), he has the loopback interface.AlberT : 127.0.0.1 is an HOST, not a network. So A and B can't stay on the same 127.0.0.1 becouse it is an host IP, not becouse it is not a real IP. If a and B are given 127.0.0.3 and 127.0.0.4 they could see each others.rmeador : @AlberT: I'm confused about what you're saying. According to RFC 3330, any address in 127.x.x.x is the loopback interface.AlberT : @meador, you are right this _class_ is not routable. But not every net stack accomplish the RFC, so is possible to have packets directed to 127.0.0.3 to be routed to a physical interface. My poit was to undeline that 127.0.0.1 _is_ an host, not a net... two hosts can't comunicate having the same IP, even if the IP is not RFC3330 or RFC1918. This was my pointMarkM : AlberT - I'm curious, in what situation is 127.x.x.x routable? I've never seen this (but again there are plenty of situations I haven't seen)minder : @AlbertT I think it's not a good idea to encourage the use non-RFC compliant network stack ;)jscott : Being pedantic about this _"...and is always available."_ Give this a try on Linux: `ifconfig lo down`From minder -
Kernel firewall packet filtering could be used to prevent ICMP packets from hitting loopback. In which case a ping would appear to fail (although the interface would still be up).
You could theoretically take it down, but then you would disable sockets. You'd have a seriously stripped down box that would boot up without loopback. It would resemble... MS-DOS!
From dland -
@Alb/ Meador: IP addresses starting by 127.X.X.X are NOT valid -- Already reserved for loopback/testing porposes.
Common usage: to test TCP/IP Protocole Stack, set a router-ID etc.... Localhost = 127.X.X.X
Aziz Rahman Abid
From Aziz Abid
0 comments:
Post a Comment