By default, the LDAP service deployed in the OMS and cluster can be accessed by any IP address. To enable the LDAP service to be accessed by only trusted IP addresses, you can configure the INPUT policy in the iptables filtering list.
After the configuration, the LDAP service cannot be accessed by IP addresses that are not configured. Before the expansion, the added IP addresses need to be configured as trusted IP addresses.
Configuring trusted IP addresses for the LDAP service on the OMS
iptables -L
For example, if no rule is configured, the INPUT policy is displayed as follows:
Chain INPUT (policy ACCEPT) target prot opt source destination
iptables -A INPUT -s Trusted IP address -p tcp --dport Port number -j ACCEPT
For example, to configure 10.0.0.1 as a trusted IP address and enable it to access port 21750, you need to run the following command:
iptables -A INPUT -s 10.0.0.1 -p tcp --dport 21750 -j ACCEPT
iptables -A INPUT -p tcp --dport Port number -j DROP
For example, to disable all IP addresses to access port 21750, run the following command:
iptables -A INPUT -p tcp --dport 21750 -j DROP
iptables -L
For example, after a trusted IP address is configured, the INPUT policy is displayed as follows:
Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT tcp -- 10.0.0.1 anywhere tcp dpt:21750 DROP tcp -- anywhere anywhere tcp dpt:21750
iptables -L -n --line-number
Chain INPUT (policy ACCEPT) num target prot opt source destination 1 DROP tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:21750
iptables -D INPUT Number of the rule to be deleted
For example, to delete rule 1, run the following command:
iptables -D INPUT 1
Configuring trusted IP addresses for the LDAP service in the cluster
iptables -L
For example, if no rule is configured, the INPUT policy is displayed as follows:
Chain INPUT (policy ACCEPT) target prot opt source destination
iptables -A INPUT -s Trusted IP address -p tcp --dport Port number -j ACCEPT
For example, to configure 10.0.0.1 as a trusted IP address and enable it to access port 21780, you need to run the following command:
iptables -A INPUT -s 10.0.0.1 -p tcp --dport 21780 -j ACCEPT
iptables -A INPUT -p tcp --dport Port number -j DROP
For example, to disable all IP addresses to access port 21780, run the following command:
iptables -A INPUT -p tcp --dport 21780 -j DROP
iptables -L
For example, after a trusted IP address is configured, the INPUT policy is displayed as follows:
Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT tcp -- 10.0.0.1 anywhere tcp dpt:21780 DROP tcp -- anywhere anywhere tcp dpt:21780
iptables -L -n --line-number
Chain INPUT (policy ACCEPT) num target prot opt source destination 1 DROP tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:21780
iptables -D INPUT Number of the rule to be deleted
For example, to delete rule 1, run the following command:
iptables -D INPUT 1