TP N°1 : Configuration carte réseau sous ROCKY LINUX 8
Prérequis
● Être à l'aise avec le fonctionnement depuis la ligne de commande
● Toutes les opérations nécessitent un accès root
● Facultatif: être familier des concepts de mise en réseau
# Configurer nom de la machine
[root@localhost ~]# hostnamectl set-hostname server.institut.tn
# afficher les interfaces
[root@localhost ~]# nmcli device
DEVICE TYPE STATE CONNECTION
enp1s0 ethernet connected enp1s0
lo loopback unmanaged --
# Metrre adresse IPv4
[root@localhost ~]# nmcli connection modify enp1s0 ipv4.addresses 200.100.10.20/24
# Mettre gateway
[root@localhost ~]# nmcli connection modify enp1s0 ipv4.gateway 200.100.10.254
# Mettre DNS
[root@localhost ~]# nmcli connection modify enp1s0 ipv4.dns 200.100.10.1
# Mettre les configurarion de DNS (mon nom domain)
1 | Conf Carte réseau sous ROCKY 8 Mme Kharrat Souhir
[root@localhost ~]# nmcli connection modify enp1s0 ipv4.dns-search institut.tn
# Metter [manual] pour paramétrer static
[root@localhost ~]# nmcli connection modify enp1s0 ipv4.method manual
# redémarrer les interfaces
[root@localhost ~]# nmcli connection down enp1s0; nmcli connection up enp1s0
Connection 'enp1s0' successfully deactivated (D-Bus active path:
/org/freedesktop/NetworkManager/ActiveConnection/1)
Connection successfully activated (D-Bus active path:
/org/freedesktop/NetworkManager/ActiveConnection/2)
# confirmer le paramétrage
[root@localhost ~]# nmcli device show enp1s0
GENERAL.DEVICE: enp1s0
GENERAL.TYPE: ethernet
GENERAL.HWADDR: 52:54:00:54:9E:CF
GENERAL.MTU: 1500
GENERAL.STATE: 100 (connected)
GENERAL.CONNECTION: enp1s0
GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveC>
WIRED-PROPERTIES.CARRIER: on
IP4.ADDRESS[1]: 200.100.10.20/24
IP4.GATEWAY: 200.100.10.254
IP4.ROUTE[1]: dst = 200.100.10.0/24, nh = 0.0.0.0, mt =
1>
IP4.ROUTE[2]: dst = 0.0.0.0/0, nh = 10.0.0.1, mt = 100
IP4.DNS[1]: 200.100.10.10
IP6.ADDRESS[1]: fe80::5054:ff:fe54:9ecf/64
IP6.GATEWAY: --
IP6.ROUTE[1]: dst = fe80::/64, nh = ::, mt = 100
IP6.ROUTE[2]: dst = ff00::/8, nh = ::, mt = 256, tabl>
# Visualiser la carte réseau
[root@localhost ~]# ip address show
2 | Conf Carte réseau sous ROCKY 8 Mme Kharrat Souhir
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group
default qlen 1000
link/ether 52:54:00:54:9e:cf brd ff:ff:ff:ff:ff:ff
inet 200.100.10.20/24 brd 10.0.0.255 scope global noprefixroute enp1s0
valid_lft forever preferred_lft forever
inet6 fe80::5054:ff:fe54:9ecf/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3 | Conf Carte réseau sous ROCKY 8 Mme Kharrat Souhir