5

When creating new interfaces with nmcli, ip address can be set with both ipv4.addresses and ip4 parameter.

Is there a differance between these?

examples

nmcli con add ifname ens192 con-name ens192 type ethernet ipv4.addresses 192.168.0.10/24

vs

nmcli con add ifname ens192 con-name ens192 type ethernet ip4 192.168.0.10/24

0

2 Answers 2

6

From nmcli manual:

Table 25. IPv4 options
┌──────┬────────────────┬────────────────────────┐
│Alias │ Property       │ Note                   │
├──────┼────────────────┼────────────────────────┤
│ip4   │ ipv4.addresses │ The alias is           │
│      │ ipv4.method    │ equivalent to the      │
│      │                │ +ipv4.addresses syntax │
│      │                │ and also sets          │
│      │                │ ipv4.method to manual. │
│      │                │ It can be specified    │
│      │                │ multiple times.        │
├──────┼────────────────┼────────────────────────┤
│gw4   │ ipv4.gateway   │                        │
└──────┴────────────────┴────────────────────────┘
1

No, in man nmcli, under Table 25 "IPv4 options" you can read that ip4 is an alias to ipv4.addresses ipv4.method. However it is noted that:

The alias is equivalent to the +ipv4.addresses syntax and also sets ipv4.method to manual. It can be specified multiple times.


General hint: always check info or man pages when unsure.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .