]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
AWS: Calculate gateway and DNS IP addresses only for RED
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 28 Jun 2018 09:57:13 +0000 (10:57 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 28 Jun 2018 09:57:13 +0000 (10:57 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/initscripts/helper/aws-setup

index e6e733fb7da5a28e4dcdc3b64445d3c7b2b945c7..10f01d8e707fc5002068bce2a4e78aa4d086b1e1 100644 (file)
@@ -103,16 +103,16 @@ import_aws_configuration() {
                local netaddress_num="$(to_integer "${netaddress}")"
                local broadcast="$(to_address $(( ipv4_address_num | (0xffffffff ^ netmask_num) )))"
 
-               # The gateway is always the first IP address in the subnet
-               local gateway="$(to_address $(( netaddress_num + 1 )))"
-
-               # The AWS internal DNS service is available on the second IP address of the VPC
-               local dns1="$(to_address $(( vpc_netaddress_num + 2 )))"
-               local dns2=
-
                case "${device_number}" in
                        # RED
                        0)
+                               # The gateway is always the first IP address in the subnet
+                               local gateway="$(to_address $(( netaddress_num + 1 )))"
+
+                               # The AWS internal DNS service is available on the second IP address of the VPC
+                               local dns1="$(to_address $(( vpc_netaddress_num + 2 )))"
+                               local dns2=
+
                                (
                                        echo "RED_TYPE=STATIC"
                                        echo "RED_DEV=red0"