HAKATEMIA
05Management

Network settings in a linux environment

Easy20MIN

This module covers how to manage network settings in a Linux environment. The management of IP addresses using the ip command-line tool in Linux can vary slightly depending on the system and distribution.

IP Address Management

Check Attached Network Interfaces

BASH
1ip link show
2
3or you can also check the ip address like this
4
5ip addr or ip a

This command shows all network interfaces, such as wireless and wired interfaces. For example, if a laptop has a Wi-Fi card and an Ethernet port, they would appear as these types of interfaces.

Determining the IP address

BASH
1ip addr add new_ip/network_mask dev interface

Replace new_ip with the new static IP address, verkon_maski with the network mask, and rajapinta with the name of the interface.

Remove IP Address

BASH
1sudo ip addr del old_ip/network_payment network dev interface

You can use this command to remove an IP address.

Remove / Enable Interface

This command shuts down (disables) a specific interface.

BASH
1sudo ip link set dev eth0 down

This command starts (enables) a previously disabled interface.

BASH
1sudo ip link set dev eth0 up

Define to use DHCP

BASH
1sudo dhclient interface

This command initiates a DHCP request on the selected interface

However, these changes will only be effective until the system is restarted. If you want to make the changes permanent, you can edit network configuration files such as /etc/network/interfaces or use NetworkManager (nmcli or a graphical interface) to make long-term changes.

1 / 5
Hakatemia Pro

Learn to hack — start here

Hundreds of interactive courses, virtual labs and CTF challenges in your browser. Start a free trial — no card required.