Network settings in a linux environment
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
1ip link show
2
3or you can also check the ip address like this
4
5ip addr or ip aThis 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
1ip addr add new_ip/network_mask dev interfaceReplace 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
1sudo ip addr del old_ip/network_payment network dev interfaceYou can use this command to remove an IP address.
Remove / Enable Interface
This command shuts down (disables) a specific interface.
1sudo ip link set dev eth0 downThis command starts (enables) a previously disabled interface.
1sudo ip link set dev eth0 upDefine to use DHCP
1sudo dhclient interfaceThis 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.
Learn to hack — start here
Hundreds of interactive courses, virtual labs and CTF challenges in your browser. Start a free trial — no card required.