Skip to content

Commit e479a86

Browse files
Raise priority of ParallelCluster configured route tables (#2857)
This commit fixes a bug from #2855, which made the route table/metric number larger (meaning lower priority). Thereafter, some unwanted default rules on AL2023 took priority and failed test_multiple_nics integration test on AL2023. This commit makes the number smaller (meaning higher priority) to fix the issue. e.g. Prior to this commit, the number for table for 1,1 is 1001001. After this commit, the number is 101+10=111. The "+10" is to properly handle table for 0,0, which has number 10. Without "+10", the table would conflict with table 0 from OS. FYI: the number of unwanted default AL2023 rule starts with 10101 Signed-off-by: Hanwen <[email protected]>
1 parent b8ed346 commit e479a86

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

cookbooks/aws-parallelcluster-environment/files/amazon-2023/network_interfaces/configure_nw_interface.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ fi
2424

2525
cd "$configuration_directory"
2626

27-
SUFFIX=$(printf "%03d" $NETWORK_CARD_INDEX)$(printf "%03d" $DEVICE_NUMBER)
28-
ROUTE_TABLE=1${SUFFIX}
27+
SUFFIX=$(printf "%03d" $NETWORK_CARD_INDEX)$(printf "%02d" $DEVICE_NUMBER)
28+
ROUTE_TABLE="$(( $SUFFIX + 10 ))"
2929

3030
ln -s /usr/lib/systemd/network/80-ec2.network ${file_name} # Use default EC2 configuration. This include MTU, etc.
3131

cookbooks/aws-parallelcluster-environment/files/default/network_interfaces/configure_nw_interface.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ then
2121
exit 1
2222
fi
2323

24-
SUFFIX=$(printf "%03d" $NETWORK_CARD_INDEX)$(printf "%03d" $DEVICE_NUMBER)
24+
SUFFIX=$(printf "%03d" $NETWORK_CARD_INDEX)$(printf "%02d" $DEVICE_NUMBER)
2525

26-
ROUTE_TABLE="1${SUFFIX}"
26+
ROUTE_TABLE="$(( $SUFFIX + 10 ))"
2727

2828
echo "Configuring device name: ${DEVICE_NAME} with IP:${DEVICE_IP_ADDRESS} CIDR_PREFIX:${CIDR_PREFIX_LENGTH} NETMASK:${NETMASK} GW:${GW_IP_ADDRESS} ROUTING_TABLE:${ROUTE_TABLE}"
2929

cookbooks/aws-parallelcluster-environment/files/redhat-8.network_interfaces/configure_nw_interface.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ then
2424
fi
2525

2626
con_name="System ${DEVICE_NAME}"
27-
SUFFIX=$(printf "%03d" $NETWORK_CARD_INDEX)$(printf "%03d" $DEVICE_NUMBER)
28-
route_table="1${SUFFIX}"
29-
priority="1${SUFFIX}"
30-
metric="1${SUFFIX}"
27+
SUFFIX=$(printf "%03d" $NETWORK_CARD_INDEX)$(printf "%02d" $DEVICE_NUMBER)
28+
route_table="$(( $SUFFIX + 10 ))"
29+
priority="${route_table}"
30+
metric="${route_table}"
3131

3232
# Rename connection
3333
original_con_name=`nmcli -t -f GENERAL.CONNECTION device show ${DEVICE_NAME} | cut -f2 -d':'`

cookbooks/aws-parallelcluster-environment/files/rocky/network_interfaces/configure_nw_interface.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ then
2424
fi
2525

2626
con_name="System ${DEVICE_NAME}"
27-
SUFFIX=$(printf "%03d" $NETWORK_CARD_INDEX)$(printf "%03d" $DEVICE_NUMBER)
28-
route_table="1${SUFFIX}"
29-
priority="1${SUFFIX}"
30-
metric="1${SUFFIX}"
27+
SUFFIX=$(printf "%03d" $NETWORK_CARD_INDEX)$(printf "%02d" $DEVICE_NUMBER)
28+
route_table="$(( $SUFFIX + 10 ))"
29+
priority="${route_table}"
30+
metric="${route_table}"
3131

3232
# Rename connection
3333
original_con_name=`nmcli -t -f GENERAL.CONNECTION device show ${DEVICE_NAME} | cut -f2 -d':'`

cookbooks/aws-parallelcluster-environment/files/ubuntu/network_interfaces/configure_nw_interface.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ if [ "${STATIC_IP_CONFIG}" = "" ]
4141
fi
4242

4343
FILE="/etc/netplan/${DEVICE_NAME}.yaml"
44-
SUFFIX=$(printf "%03d" $NETWORK_CARD_INDEX)$(printf "%03d" $DEVICE_NUMBER)
45-
ROUTE_TABLE="1${SUFFIX}"
44+
SUFFIX=$(printf "%03d" $NETWORK_CARD_INDEX)$(printf "%02d" $DEVICE_NUMBER)
45+
ROUTE_TABLE="$(( $SUFFIX + 10 ))"
4646

4747
echo "Configuring ${DEVICE_NAME} with IP:${DEVICE_IP_ADDRESS} CIDR_PREFIX:${CIDR_PREFIX_LENGTH} NETMASK:${NETMASK} GW:${GW_IP_ADDRESS} ROUTING_TABLE:${ROUTE_TABLE}"
4848

0 commit comments

Comments
 (0)