You have to set up port forwarding on your router. The port ranges from 10480 - 10489. (The range could be smaller but I'm using this range to cover everything). Each router has a different method to set it up, so you'll have to find out how to do it for yours.
If your friend is connecting through the internet, then you have to give your friend your public IP (The internet IP that the router is using), not your LAN IP (usually defaults to 192.168.X.X). Your friend uses the public IP to do a direct IP connection. (Basically, it technically connects to your router, which your router will forward to your computer instead.)
If your friend is connecting from within the same network (LAN), then use the LAN IP. (Public IP also works but can be laggier. Your friend basically routes out of your network and then back in. :P )
Orravan: I would like to host a co op game using direct ip but it wont allow me to start one because it says "Invalid CD Key." GOG website claims that multiplayer only works on LAN or Direct IP connection.. if that was true for direct ip connect, why is it still showing "invalid CD Key." If i try to host using LAN, and my buddy tries to connect using my ip.... It wont show up or says failed to connect
Don't use Internet hosting. Use LAN hosting with port forwarding. Direct IP connection from the internet will work if you provide your public IP (i.e. your router's IP).