github.com/coreos/rocket@v1.30.1-0.20200224141603-171c416fac02/Documentation/networking/overriding-defaults.md (about) 1 # Overriding defaults 2 3 This document holds information about modifying or replacing builtin defaults and is only recommended to advanced users. 4 Please make sure to have read the [networking overview page][overview] before treading into these things. 5 6 ## Overriding the "default" network 7 8 If a network has a name "default", it will override the default network added by rkt. 9 It is strongly recommended that such network also has type "ptp" as it protects from the pod spoofing its IP address and defeating identity management provided by the metadata service. 10 11 ## Overriding network settings 12 13 The network backend CNI allows the passing of [arguments as plugin parameters][cni-plugin-parameters], specifically `CNI_ARGS`, at runtime. 14 These arguments can be used to reconfigure a network without changing the configuration file. 15 rkt supports the `CNI_ARGS` variable through the command line argument `--net`. 16 17 ### Syntax 18 19 The syntax for passing arguments to a network looks like `--net="$networkname1:$arg1=$val1;$arg2=val2"`. 20 When executed from a shell, you can use double quotes to avoid `;` being interpreted as a command separator by the shell. 21 To allow the passing of arguments to different networks simply append the arguments to the network name with a colon (`:`), and separate the arguments by semicolon (`;`). 22 All arguments can either be given in a single instance of the `--net`, or can be spread across multiple uses of `--net`. 23 *Reminder:* the separator for the networks (and their arguments) within one `--net` instance is the comma `,`. 24 A network name must not be passed more than once, not within the same nor throughout multiple instances of `--net`. 25 26 ### Example: Passing arguments to two different networks 27 28 This example will override the IP in the networks _net1_ and _net2_. 29 30 ```bash 31 rkt run --net="net1:IP=1.2.3.4" --net="net2:IP=1.2.4.5" pod.aci 32 ``` 33 34 ### Example: load all networks and override IPs for two different networks 35 36 This example will load all configured networks and override the IP addresses for *net1* and *net2*. 37 38 ```bash 39 rkt run --net="all,net1:IP=1.2.3.4" --net="net2:IP=1.2.4.5" pod.aci 40 ``` 41 42 ### Supported CNI\_ARGS 43 44 This is not documented yet. 45 Please follow CNI issue [#56][cni-56] to track the progress of the documentation. 46 47 48 [cni-56]: https://github.com/containernetworking/cni/issues/56 49 [cni-plugin-parameters]: https://github.com/containernetworking/cni/blob/master/SPEC.md#parameters 50 [overview]: overview.md