2

Still trying to understand the IP slash notation.

I am configuring my OSX laptop to connect to the Internet behind the corporate proxy. For the loopback address to work on my local machine after setting the proxy IP and port, I set up 127.255/8 as an exception (that is, I suppose: addresses my computer will contact directly without using the proxy). What I want to do is to exclude the entire range from 127.0.0.1 to 127.255.255.255 from being looked up through the proxy.

I've tried to put 127/8 but this notation does not work, I guess because there could be ambiguity in a text field where I can put unresolved addresses (google.com) as well.

The question is: has that "255" some relevance? Could I put anything between 0 to 255 after the dot? Or should I put a dummy address (127.255.255.255/8) just to fill in the groups?

1
  • 2
    Why are you using 127/8? That's the local loopback address. Commented Sep 14, 2015 at 12:53

2 Answers 2

0

An IP address and its mask are 32 bits each. To get the subnet, you AND, bitwise, the IP address with the mask. In your example (I assume you mean 127.255.0.0/8 as the IP address), only the first 8 bits of the IP address comprise the subnet since 127.255.0.0 AND 255.0.0.0 equals 127.0.0.0.

You can also subnet further. For instance, 127.255.0.0/16 is a subnet of the network 127.0.0.0/8 which is an aggregate of all the subnets and addresses with 127 in the first octet.

As @RonTrunk points out, the IP address range of 127.0.0.0/8 is reserved as the host loopback address, so this is not a range you should not use beyond the host on which it is configured. Typically, you would use 127.0.0.1 as the loopback address to refer to the host itself, and each host will use this address to refer to itself so it has a different meanings outside the host on which you use it.

Putting this on a proxy means that the proxy will use the proxy itself in the exception rule, not the host you intend to be the exception. You must use the LAN IP address of the host in the proxy exception rule, and if you mean only that host, use must use a /32 on the address.

I really don't think that you should be changing proxy rules if you have such a small understanding of IP addressing.

1
  • This answer (thank you) made me realize my question was not well explained. I'm retrying Commented Sep 15, 2015 at 7:28
0

I try to answer to my question based on what I've found googling around. Please help me if I'm wrong.

The so-called slash notation is a way to assign a block of IPs to a given subnet, granting the ability to divide the IP addresses in blocks of 32 different lengths. In other words, it lets you define a given prefix from 1 to 32 bits in length. This is needed when you need to define IP blocks with more grain than what you can get with the triplet-based segmentation (4 blocks, giving four "classes").

An example from Wikipedia:

92.168.100.14/24 represents the IPv4 address 192.168.100.14 and its associated routing prefix 192.168.100.0, or equivalently, its subnet mask 255.255.255.0, which has 24 leading 1-bits.

That leads me to think that in order to define a specific IP range (or a specific prefix), the conventional notation is to set the triplets to zero.

To refer to the IPv4 loopback range, you should then write 127.0.0.0/8.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.