Edit the config for the network Custom Resource (CR) instance spec.externalIP.policy.allowedCIDRs
with the CIDRs to use.
- Edit the Cluster network configuration:
oc edit network.config.openshift.io cluster
- Edit the
spec.externalIP.policy.allowedCIDRs
. The following enable192.168.18.64/26
as anexternalIP
CIDR:
....
spec:
clusterNetwork:
- cidr: 10.128.0.0/14
hostPrefix: 23
externalIP:
policy:
allowedCIDRs:
- 192.168.18.64/26
networkType: OpenShiftSDN
serviceNetwork:
- 172.30.0.0/16
...
- Validate changes where applied to the CR
oc get network.operator.openshift.io cluster -o yaml
- Wait few minutes while the Network Operator apply the configuration changes
oc patch svc demo-service -p '{"spec":{"externalIPs":["192.168.18.65"]}}'