Addresses in the 169.254.0.0 range are IPv4 link-local addresses. Are you sure it was 162 and not 169? A link-local address would indicate that DHCP is not available. DHCP is the service from your router which automatically provides an IP address to your computer. It can be very useful to set a static IP address while you troubleshoot DHCP.
Unfortunately, troubleshooting DHCP can be a bear. Start by putting yourself back on the network your router is on (the router is most likely 192.168.0.1 or 192.168.1.1) and navigating to your router's settings to see if DHCP is on. If you can't find your router at 192.168.0.1 or 192.168.1.1 by putting http://[ip address] in your browser, something is probably wrong with the router. Otherwise you're going to need help troubleshooting DHCP issues on OS X.