@@ -37,6 +37,7 @@ LB_NSG_OCID=""
37
37
FSS_NSG_OCID=" "
38
38
LPG_OCID=" "
39
39
ALL_IPS=" 0.0.0.0/0"
40
+ LB_SOURCE_CIDR=" "
40
41
NETWORK_VALIDATION_MSG=" Fix the network validation script errors and re-run the script in the cloud shell"
41
42
42
43
debug=false
@@ -240,6 +241,9 @@ function check_tcp_port_open_in_seclist_or_nsg() {
240
241
else
241
242
source_in_cidr_range=1
242
243
fi
244
+ elif [[ $source = " " ]]
245
+ then
246
+ source_in_cidr_range=0
243
247
else
244
248
source_in_cidr_range=$( in_cidr_range $ingress_source $source ; echo $? )
245
249
fi
@@ -519,9 +523,10 @@ This script is used to validate existing subnets, and optionally network securit
519
523
-g, --lpg OCID of the Local Peering Gateway (LPG) in the DB VCN
520
524
-b, --bastionsubnet Bastion Subnet OCID
521
525
-i, --bastionip Bastion Host IP. Provide this if using existing bastion
526
+ -j, --lbsourcecidr Load Balance Source CIDR
522
527
-u, --lbsubnet1 Load Balancer Subnet 1 OCID
523
528
-v, --lbsubnet2 Load Balancer Subnet 2 OCID which is required only for AD subnet
524
- -l, --externalport WebLogic Managed Server External Port
529
+ -l, --externalport WebLogic Managed Server External Port
525
530
-f, --fsssubnet File Storage Service (FSS) Mount Target Subnet OCID
526
531
-a, --adminsrvnsg OCID of the Network Security Group (NSG) for the administration server (Required if using NSGs instead of security lists)
527
532
-m, --managedsrvnsg OCID of the Network Security Group (NSG) for the managed servers (Required if using NSGs instead of security lists)
@@ -587,6 +592,7 @@ while [[ $1 = -?* ]]; do
587
592
-g|--lpg) shift ; LPG_OCID=${1} ;;
588
593
-b|--bastionsubnet) shift ; BASTION_SUBNET_OCID=${1} ;;
589
594
-i|--bastionip) shift ; BASTION_HOST_IP=${1} ;;
595
+ -j|--lbsourcecidr) shift ; LB_SOURCE_CIDR=${1} ;;
590
596
-u|--lbsubnet1) shift ; LB_SUBNET_1_OCID=${1} ;;
591
597
-v|--lbsubnet2) shift ; LB_SUBNET_2_OCID=${1} ;;
592
598
-l|--externalport) shift ; WLS_LB_PORT=${1} ;;
@@ -963,20 +969,18 @@ if [[ -n ${LB_SUBNET_1_OCID} ]]
963
969
then
964
970
if [[ -z ${LB_NSG_OCID} ]]
965
971
then
966
- res=$( validate_subnet_port_access " ${LB_SUBNET_1_OCID} " ${LB_PORT} " ${ALL_IPS } " )
972
+ res=$( validate_subnet_port_access " ${LB_SUBNET_1_OCID} " ${LB_PORT} " ${LB_SOURCE_CIDR } " )
967
973
if [[ $res -ne 0 ]]
968
974
then
969
- echo " ERROR: Port [$LB_PORT ] is not open for 0.0.0.0/0 in LB Subnet CIDR [${LB_SUBNET_1_OCID} ]. ${NETWORK_VALIDATION_MSG} "
970
- validation_return_code=2
975
+ echo " WARNING : Port [$LB_PORT ] is not open for ${LB_SOURCE_CIDR} in LB Subnet CIDR [${LB_SUBNET_1_OCID} ]. ${NETWORK_VALIDATION_MSG} "
971
976
fi
972
977
else
973
978
if [[ -n ${ADMIN_SRV_NSG_OCID} && -n ${MANAGED_SRV_NSG_OCID} ]]
974
979
then
975
- res=$( check_tcp_port_open_in_seclist_or_nsg $LB_NSG_OCID " ${LB_PORT} " " $ALL_IPS " " nsg" )
980
+ res=$( check_tcp_port_open_in_seclist_or_nsg $LB_NSG_OCID " ${LB_PORT} " " ${LB_SOURCE_CIDR} " " nsg" )
976
981
if [[ $res -ne 0 ]]
977
982
then
978
- echo " ERROR: Port [$LB_PORT ] is not open for 0.0.0.0/0 in Load Balancer Server NSG [${LB_NSG_OCID} ]. ${NETWORK_VALIDATION_MSG} "
979
- validation_return_code=2
983
+ echo " WARNING : Port [$LB_PORT ] is not open for ${LB_SOURCE_CIDR} in Load Balancer Server NSG [${LB_NSG_OCID} ]. ${NETWORK_VALIDATION_MSG} "
980
984
fi
981
985
fi
982
986
fi
@@ -1014,20 +1018,18 @@ if [[ -n ${LB_SUBNET_2_OCID} ]]
1014
1018
then
1015
1019
if [[ -z ${LB_NSG_OCID} ]]
1016
1020
then
1017
- res=$( validate_subnet_port_access " ${LB_SUBNET_2_OCID} " ${LB_PORT} " ${ALL_IPS } " )
1021
+ res=$( validate_subnet_port_access " ${LB_SUBNET_2_OCID} " ${LB_PORT} " ${LB_SOURCE_CIDR } " )
1018
1022
if [[ $res -ne 0 ]]
1019
1023
then
1020
- echo " ERROR: Port [$LB_PORT ] is not open for 0.0.0.0/0 in LB Subnet CIDR [${LB_SUBNET_2_OCID} ]. ${NETWORK_VALIDATION_MSG} "
1021
- validation_return_code=2
1024
+ echo " WARNING: Port [$LB_PORT ] is not open for ${LB_SOURCE_CIDR} in LB Subnet CIDR [${LB_SUBNET_2_OCID} ]. ${NETWORK_VALIDATION_MSG} "
1022
1025
fi
1023
1026
else
1024
1027
if [[ -n ${ADMIN_SRV_NSG_OCID} && -n ${MANAGED_SRV_NSG_OCID} ]]
1025
1028
then
1026
- res=$( check_tcp_port_open_in_seclist_or_nsg $LB_NSG_OCID " ${LB_PORT} " " $ALL_IPS " " nsg" )
1029
+ res=$( check_tcp_port_open_in_seclist_or_nsg $LB_NSG_OCID " ${LB_PORT} " " ${LB_SOURCE_CIDR} " " nsg" )
1027
1030
if [[ $res -ne 0 ]]
1028
1031
then
1029
- echo " ERROR: Port [$LB_PORT ] is not open for 0.0.0.0/0 in Load Balancer Server NSG [${LB_NSG_OCID} ]. ${NETWORK_VALIDATION_MSG} "
1030
- validation_return_code=2
1032
+ echo " WARNING: Port [$LB_PORT ] is not open for ${LB_SOURCE_CIDR} in Load Balancer Server NSG [${LB_NSG_OCID} ]. ${NETWORK_VALIDATION_MSG} "
1031
1033
fi
1032
1034
fi
1033
1035
fi
0 commit comments