ifconfig will give you your private ip address as given to your machine by your router... eg 192.168.x.y.
This is internal only.
What you get from 'whatsmyip' is your EXTERNAL address ie your IP Address on the internet.
Unless you pay extra, most IP's only give you a Dynamic IP (ie your external IP) and this can change each time you restart your router/modem.
There are various workarounds to this; I suggest you hit up google and gain a thorough understanding before you go any further.