I would guess that Excel is doing its best. As you don't say what is going wrong, I can only guess at it. Excel starts sorting string figures at 0 or in the case of IP addresses, at 1. It doesn't matter if it is 1 10 or 100. This means that 2 is bigger than 100, which leads to confusion.
The only solution I can see is to format the cells as text, add leading zeros to the addresses, sort and then using find and replace throw out the leading zeros again. Be careful not to throw out all of the zeros, however.
All the best,
Carol
Berlin, Germany