Using Control Center with a NAT device
Network address translation (NAT) enables one device (a router, switch, or firewall) to connect a local area network with the internet and outside devices. The NAT device forwards traffic to the intended host, and serves as a firewall to systems that are behind the device, making them inaccessible from outside the network.
In a Control Center system without a NAT device, the master host connects directly to the delegate host's address:rpcport and requests host information.
When the Control Center master host is outside the network, it can connect to the NAT device, but cannot access delegate hosts behind the device because they have private IP addresses. The NAT device forwards its port to the delegate hosts' address:rpcport.
When you add a delegate host by using either Control Center interface (browser or command-line) you must specify the hostname or IP address and port for the NAT device. After you add delegate hosts, you must transfer host keys to the delegate hosts and register them.
The Control Center master host always attempts registration on port 22. If the NAT device forwards port 22 to the delegate host that you are registering, you can remotely register the keys.
serviced host add Hostname-Or-IP:Host-Port \ --nat-address==NAT-Hostname-Or-IP:NAT-Port \ [–register]
When resetting keys, the CLI supports the --nat-address argument. If the delegate is behind a NAT device and port 22 is forwarded to that delegate, you can attempt to register the delegate when resetting the key:
serviced key reset Hostname-Or-IP:Host-Port --register \ --nat-address==NAT-Hostname-Or-IP:NAT-Port
Example: Adding delegate hosts to a resource pool
- NAT router: 192.0.2.0
- Delegate1: 198.51.100.0:4979
- Delegate2: 203.0.113.0:4979
serviced host add 198.51.100.0:4979 Resource-Pool \ --nat-address=192.0.2.0:4979
serviced host add 203.0.113.0:4979 Resource-Pool \ --nat-address=192.0.2.0:4980
Security considerations for using Control Centerwith a NAT device
To attach to a service on a delegates behind the NAT device, you must use ssh to access the delegate. From the delegate host, run serviced service attach. For security reasons, you cannot use serviced service attach from the master to connect to a delegate.
In the Control Center browser interface, for security reasons, you cannot drill down to a service that is running on a delegate behind a NAT device and click Container Log for the instance