File tree Expand file tree Collapse file tree 4 files changed +15
-10
lines changed Expand file tree Collapse file tree 4 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,9 @@ def add_arguments(parser):
37
37
parser .add_argument ('-d' , '--docker' , action = 'store_true' ,
38
38
help = 'Create a docker compose configuration' )
39
39
parser .add_argument ('-n' , '--network' ,
40
- help = 'Network to create subnets in (E.g. "127.0.0.0/8"' )
40
+ help = 'IPv4 network to create subnets in (E.g. "127.0.0.0/8"' )
41
+ parser .add_argument ('-n6' , '--network-v6' ,
42
+ help = 'IPv6 network to create subnets in (E.g. "fd00:f00d:cafe::7f00:0000/104"' )
41
43
parser .add_argument ('-o' , '--output-dir' , default = GEN_PATH ,
42
44
help = 'Output directory' )
43
45
parser .add_argument ('--random-ifids' , action = 'store_true' ,
Original file line number Diff line number Diff line change @@ -76,15 +76,17 @@ def __init__(self, args):
76
76
logging .critical ("Cannot use sig without docker!" )
77
77
sys .exit (1 )
78
78
self .default_mtu = None
79
- self ._read_defaults (self . args . network )
79
+ self ._read_defaults ()
80
80
81
- def _read_defaults (self , network ):
81
+ def _read_defaults (self ):
82
82
"""
83
83
Configure default network.
84
84
"""
85
85
defaults = self .topo_config .get ("defaults" , {})
86
- self .subnet_gen4 = SubnetGenerator (DEFAULT_NETWORK , self .args .docker )
87
- self .subnet_gen6 = SubnetGenerator (DEFAULT6_NETWORK , self .args .docker )
86
+ self .subnet_gen4 = SubnetGenerator (self .args .network , self .args .docker ) \
87
+ if self .args .network else SubnetGenerator (DEFAULT_NETWORK , self .args .docker )
88
+ self .subnet_gen6 = SubnetGenerator (self .args .network_v6 , self .args .docker ) \
89
+ if self .args .network_v6 else SubnetGenerator (DEFAULT6_NETWORK , self .args .docker )
88
90
self .default_mtu = defaults .get ("mtu" , DEFAULT_MTU )
89
91
self .dispatched_ports = defaults .get ("dispatched_ports" , DEFAULT_DISPATCHED_PORTS )
90
92
Original file line number Diff line number Diff line change 40
40
#: IPv6 min value
41
41
SCION_MIN_MTU = 1280
42
42
43
+ # Default IPv4 network
44
+ DEFAULT_NETWORK = "127.0.0.0/8"
45
+ DEFAULT_PRIV_NETWORK = "192.168.0.0/16"
46
+ DEFAULT_SCN_DC_NETWORK = "172.20.0.0/20"
47
+
43
48
# Default IPv6 network, our equivalent to 127.0.0.0/8
44
49
# https://en.wikipedia.org/wiki/Unique_local_address#Definition
45
50
DEFAULT6_MASK = "/104"
Original file line number Diff line number Diff line change 37
37
import yaml
38
38
39
39
# SCION
40
- from topology .defines import DEFAULT6_NETWORK_ADDR
41
-
42
- DEFAULT_NETWORK = "127.0.0.0/8"
43
- DEFAULT_PRIV_NETWORK = "192.168.0.0/16"
44
- DEFAULT_SCN_DC_NETWORK = "172.20.0.0/20"
40
+ from topology .defines import DEFAULT_NETWORK , DEFAULT_SCN_DC_NETWORK , DEFAULT6_NETWORK_ADDR
45
41
46
42
IPAddress = Union [IPv4Address , IPv6Address ]
47
43
IPNetwork = Union [IPv4Network , IPv6Network ]
You can’t perform that action at this time.
0 commit comments