0% found this document useful (0 votes)
28 views

002 Setup Network Parameters

The document provides instructions for creating a new network connection using the provided IP address, gateway, DNS server, and interface values. The answer recommends using the nmcli command to add a new connection with the given parameters and interface, then modify the connection to add the DNS server and disable automatic DNS. It suggests checking and activating the new connection.

Uploaded by

Maher Mechi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

002 Setup Network Parameters

The document provides instructions for creating a new network connection using the provided IP address, gateway, DNS server, and interface values. The answer recommends using the nmcli command to add a new connection with the given parameters and interface, then modify the connection to add the DNS server and disable automatic DNS. It suggests checking and activating the new connection.

Uploaded by

Maher Mechi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Setup network parameters

Question:
Please create new network connection using provided values:

IP: some.ip.to.be.used/mask

Gateway: some.gateway.to.be.used

DNS server: some.dns.to.be.used

Interface: eth0

(scroll down for an answer)


Answer:
Issue following command (as one liner) to set connection data (we assume type is ethernet
connection as used interface is called eth0):

nmcli conn add conn-name MY_CONNECTION ifname eth0 type ethernet


ip4 SOME.IP.TO.BE.USED/mask
gw4 SOME.GATEWAY.TO.BE.USED

that command adds connection for specific interface - however we still need to add DNS
resolving. Notice [+] in the command - if used with + sign provided DNS will be added to the
list of DNS being used. If we omit + sign the whole list will be replaced by provided value:

nmcli conn modify MY_CONNECTION [+]ipv4.dns SOME.DNS.TO.BE.USED


nmcli conn mod MY_CONNECTION ipv4.ignore-auto-dns yes # to disable DHCP DNS

at the final stage it is wise to start this connection:

nmcli conn show --active # to check if the connection is not up


nmcli conn up MY_CONNECTION
nmcli conn show --active # to check if the connection is up

Additional comment:
It is possible to edit existing connection using nmtui tool which can be easier. Also when using GUI
there is also graphical interface for it.

You might also like