Ubuntu 22.04 LTS: Manage Network

ubuntu22-04

Initial Settings

This section is explain how to change or configure network to static IP Address on Ubuntu 22.04 LTS as server.

Step [1] The interface name [enp1s0] is different on each environment, replace it to your own one.


# rename to disable default setting
root@bizantum:~# mv /etc/netplan/00-installer-config.yaml /etc/netplan/00-installer-config.yaml.org
root@bizantum:~# vi /etc/netplan/01-netcfg.yaml
# create new
network:
  ethernets:
    # interface name
    enp1s0:
      dhcp4: false
      # IP address/subnet mask
      addresses: [10.0.0.30/24]
      # default gateway
      # [metric] : set priority (specify it if multiple NICs are set)
      # lower value is higher priority
      routes:
        - to: default
          via: 10.0.0.1
          metric: 100
      nameservers:
        # name server to bind
        addresses: [10.0.0.10,10.0.0.11]
        # DNS search base
        search: [srv.world,server.education]
      dhcp6: false
  version: 2

# apply changes
root@bizantum:~# netplan apply
root@bizantum:~# ip addr
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:ab:95:2c brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.30/24 brd 10.0.0.255 scope global enp1s0
       valid_lft forever preferred_lft forever
    inet6 fe80::5054:ff:feab:952c/64 scope link
       valid_lft forever preferred_lft forever

Step [2] If you don't need IPv6, it's possible to disable it like follows.


root@bizantum:~# echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf
root@bizantum:~# sysctl -p
net.ipv6.conf.all.disable_ipv6 = 1
root@bizantum:~# ip addr
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
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 52:54:00:ab:95:2c brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.30/24 brd 10.0.0.255 scope global enp1s0
       valid_lft forever preferred_lft forever

Comments

Popular posts from this blog

Debian 12 Bookworm: Install Kubeadm
Introduction In this article, we will explore the what, who, where, when, why, and how of Kubeadm functionality on the Debian 12 Bookworm platform, so let's get started.
Fedora 40 : Mail Server
Introduction This guide covers the installation and configuration of a mail server on Fedora 40. It will help you understand the what, who, where, when, why, and how of setting up a mail server.
Cyber Security: NIST Overview
Overview The National Institute of Standards and Technology (NIST) is a pivotal entity in the United States that plays a crucial role in advancing measurement science, standards, and technology. Understanding NIST’s functions, importance, and impact is vital for various industries and sectors.
Cyber Security: ISO 27001 Overview
Introduction ISO 27001 is an international standard for information security management systems (ISMS). It provides a framework for managing sensitive company information to ensure it remains secure. Understanding ISO 27001 is crucial for organizations aiming to protect their information assets.
AlmaLinux 9: How to Install
Introduction AlmaLinux 9 Server is a free and open-source Linux distribution that provides a stable and secure platform for server environments. It's a popular choice for both enterprise and personal use due to its reliability and robust features. This guide will walk you through the steps to install AlmaLinux 9 Server on your system.
AlmaLinux 9: Overview
Introduction AlmaLinux 9 is a robust, open-source enterprise operating system that serves as a community-driven alternative to CentOS. Designed to deliver stability, performance, and long-term support, AlmaLinux is an excellent choice for servers in diverse environments, from small businesses to large enterprises.