Use a technology called NAT which does not allow remote hosts to connect to your network, however they can still do a port scan. You can set up dummy ports and/or other things to make it more difficult. However, most networks are on private IPs with only one Public IP giving them internet access typically.