Here is the breakdown.
The echo will output whatever is in the variable $ipaddr
This is then piped through to the following command.
Cut can be used to delimit (i.e. split into parts) a string. A parameter to cut tells it where to "cut" the string (here it is on points, so if the IP address is of the following format: "198.51.100.0", it will be split into 198 51 100 and 0). Another parameter tells it which parts, of the string that it has cut, it should take. Here it is parts 2 and 3. In the example ip I gave above, this would give 51 and 100. A final paramter tells it to put together the parts it has selected (parts 2 and 3) with a new delimiter (here a slash). The result would be 51/100.
cut --delimiter=. --fields=2-3 --output-delimiter=/
The result of all this (in my example being 51/100) is saved inside the segments variable. Whenever you run the following:
whatever is between the backticks is executed. What it returns is passed to the left side of the equals sign.