There is no way to accomplish this without using something that is outside of your network.
The address returned is the first public ip address between your computer and the outside world. 10., 192.168., 172.[16-31].* ip address are "private" and should not be forwarded intact to any non-private ip address.
At some point, private ip addresses must be linked to a public ip address. The first public ip address in the path from your computer to the whatsmyip.com site is what is displayed on that page. The trick is that your computer might have a public ip, or there might be some number of hops to computers/switches/routers that have private ip's until there is eventually a public ip. There is no way to know what that number of hops is, and depending on the network the route can change from one request to another and there migth be a different number of hops each time (unlikely for a home network, but more likely in a corporate network).
The only way to get the first public ip address is to send a packet to an address that is public, and trace the route that it took. Again...that route can (and does) change on a complex network.
If you have a specific problem that you are trying to solve, there might be a better answer.