]> git.proxmox.com Git - pve-common.git/blobdiff - src/PVE/Network.pm
add netmasks starting from /8 to local netmask list
[pve-common.git] / src / PVE / Network.pm
index 0a984ad32f9e51bc0ab145c073253991edb5dcf1..ce4305a3390454f71d3141f14146965079c1a0c2 100644 (file)
@@ -56,6 +56,14 @@ our $ipv4_reverse_mask = [
 ];
 
 our $ipv4_mask_hash_localnet = {
+    '255.0.0.0' => 8,
+    '255.128.0.0' => 9,
+    '255.192.0.0' => 10,
+    '255.224.0.0' => 11,
+    '255.240.0.0' => 12,
+    '255.248.0.0' => 13,
+    '255.252.0.0' => 14,
+    '255.254.0.0' => 15,
     '255.255.0.0' => 16,
     '255.255.128.0' => 17,
     '255.255.192.0' => 18,
@@ -71,6 +79,8 @@ our $ipv4_mask_hash_localnet = {
     '255.255.255.240' => 28,
     '255.255.255.248' => 29,
     '255.255.255.252' => 30,
+    '255.255.255.254' => 31,
+    '255.255.255.255' => 32,
 };
 
 sub setup_tc_rate_limit {
@@ -179,6 +189,8 @@ my $bridge_add_interface = sub {
        if ($tag) {
            system("/sbin/bridge vlan add dev $iface vid $tag pvid untagged") == 0 ||
            die "unable to add vlan $tag to interface $iface\n";
+
+           warn "Caution: Setting VLAN ID 1 on a VLAN aware bridge may be dangerous\n" if $tag == 1;
        } else {
            system("/sbin/bridge vlan add dev $iface vid 2-4094") == 0 ||
            die "unable to add default vlan tags to interface $iface\n" if !$trunks;