Have you changed $ALGORAND_DATA/config.json (for algod) and $ALGORAND_DATA/kmd/kmd-v0.5/kmd_config.json (for kmd) to allow connections from any IP? By default, it only allows connections from localhost.
Concretely, have you set EndpointAddress to 0.0.0.0:8080 for algod and address to 0.0.0.0:7833 for kmd?
See: