Social

How to use Linux ip addr command

Add an IP address to an Interface

For example:  add the IP address “192.168. 7.22” to the ‘wlp6s0’ interface. To add this Ip address, execute the command as follows: sudo ip addr add 192.168.

As a Linux user, you may have used the ip addr command at some point. But do you know what this command does and how it can be useful?

ip addr command is used to check the IP address of a network interface

The ip addr command is a basic networking utility used to view, add, and delete IP addresses on network interfaces. By default, the ip addr command displays information about all network interfaces on a Linux system. This includes information such as the name of each interface, its IP addresses, the netmask, broadcast address, and the status of the interface (up or down).

With this command, I can easily view information about my system’s current networking configuration and make adjustments as needed. This makes ip addr an invaluable tool for efficiently resolving any network-related issues.

Here’s an example of the ip addr command and its output:

$ 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: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether fa:16:3e:18:3a:76 brd ff:ff:ff:ff:ff:ff
inet 10.254.222.37/23 brd 10.254.223.255 scope global dynamic eth0
valid_lft 74268sec preferred_lft 74268sec

This output shows information about two network interfaces on the system: lo (the loopback interface) and eth0 (a network interface card).

For each interface, the output shows:

  • The name of the interface (e.g. lo, eth0)
  • The status of the interface (e.g. UP)
  • The MAC address (e.g. 00:11:22:33:44:55)
  • The IP addresses assigned to the interface (e.g. 127.0.0.1, 192.168.0.100)
  • The netmask (e.g. /8, /24)
  • The broadcast address (e.g. brd 192.168.0.255)

This information can be useful when troubleshooting network connectivity issues, or when configuring network interfaces on a Linux system.

If you want to view information about a specific interface, you can specify the interface name as an argument to the ip addr command. For example, to view information about the eth0 interface, you can use the following command:

ip addr show eth0

This will display information about the eth0 interface, including its IP addresses, netmask, broadcast address, and status. The ip addr add command is used to assign an IP address to a network interface and make it available on the network.

To use this command, you must first specify the IP address that you want to assign, followed by the name of the interface you are working with. For example, to assign the IP address 192.168.1.20, you would type: ip addr add 192.168.1.20/32 dev eth0.

If you need to delete an IP address from a network interface, you can use ip addr del command. This command can be useful for removing old or unused IP addresses and for reorganizing your network configuration.

To use this command, you must first specify the IP address that you want to delete, followed by the name of the interface you are working with. For example, to delete the IP address 192.168.1.20, you would type: ip addr del 192.168.1.20 dev eth0.

ip addr command displays information about all the network interfaces on a Linux system. This includes the IP address, netmask, broadcast address, and more. The ip addr command is useful for troubleshooting networking issues.

[mai mult...]

Check HDD/SSD failures with chkdsk

Check HDD/SSD failures with chkdsk
  1. Boot into your Windows.
  2. Click Start.
  3. Go to Computer.
  4. Right-click on the main drive you want to check.
  5. Click Properties.
  6. At the Tools tab, click Get started at the Error-checking section.
  7. Check the Automatically fix file system errors checkbox.
  8. Click Start.

Example:

[mai mult...]

How to find mac address In Linux

How to find mac address In Linux

Here are some methods to get the MAC address. These commands are safe to run without changing anything. The following commands can get you the MAC address of your network interface in Linux.

  • ifconfig -a
  • ifconfig eth0
  • ip link show
  • ip -o link show eth0
  • ip -o link show |cut -d ‘ ‘ -f 2,20
  • cat /sys/class/net/*/address
Procedures to find MAC address in Linux
  • Open the terminal application.
  • Type ifconfig -a or ip link show or cat /sys/class/net/*/address command
  • Press Enter to run the command.
  • The output will display the MAC address for all the network interfaces.
On a Linux machine
  1. Open a terminal window.
  2. Type ifconfig at the command prompt. Your MAC address will be displayed beside the label HWaddr.
MacOS/Linux
  1. Open a Terminal app.
  2. Type /sbin/ifconfig this will list your IP address as well your MAC address.
  3. You can use cmd+a to select all, cmd+c to copy and it can be pasted to any text field.
[mai mult...]

How to check MTU size in Linux

In networking, maximum transmission unit (MTU) is a measurement representing the largest data packet that a network-connected device will accept. Imagine it as being like a height limit for freeway underpasses or tunnels: Cars and trucks that exceed the height limit cannot fit through, just as packets that exceed the MTU of a network cannot pass through that network.

However, unlike cars and trucks, data packets that exceed MTU are broken up into smaller pieces so that they can fit through. This process is called fragmentation. Fragmented packets are reassembled once they reach their destination. MTU is measured in bytes — a “byte” is equal to 8 bits of information, meaning 8 ones and zeroes. 1,500 bytes is the maximum MTU size.

It is important to check MTU size because the wrong setting can lead to poor network performance. A too-large MTU can cause fragmentation, which can lead to lower throughput and higher latency. A too-small MTU can also cause problems, such as dropped packets and retransmissions.

The best practice for MTU size in Linux is to set the MTU size to the same size as the largest packet size that your network can handle. This will help to ensure that packets are not dropped due to being too large.

check MTU size with ifconfig Command in Linux

The easiest way to check MTU size in Linux is using the ifconfig command. Open the terminal and run ifconfig interface name |grep mtu. This command will list the configuration of a network interface including MTU size.

Replace [interface] with the name of your network interface. For example, if you want to view the MTU size of the eth0 interface, you would use the following command: ifconfig eth0 | grep mtu

To change the MTU size of a network interface, use the following command: ifconfig [interface] mtu [size]

Replace [interface] with the name of your network interface and [size] with the desired MTU size. For example, to change the MTU size of the eth0 interface to 1400 bytes, you would use the following command: ifconfig eth0 mtu 1400

check MTU size with ip Command in Linux

The ip command can be used to show or set various network interface parameters. To view the MTU size of a network interface, use the following command: ip link show dev [interface]

Replace [interface] with the name of your network interface. For example, if you want to view the MTU size of the eth0 interface, you would use the following command: ip link show dev eth0

The output of this command will look something like this:
eth0: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:11:22:33:44:55 brd ff:ff:ff:ff:ff:ff

As you can see, the MTU size is 1500 bytes for this interface.To change the MTU size of a network interface, use the following command: ip link set dev [interface] mtu [size]

For example, to change the MTU size of the eth0 interface to 1400 bytes, you would use the following command: ip link set dev eth0 mtu 1400.

[mai mult...]

Ce inseamna BIOS, CMOS si UEFI?

BIOS înseamnă sistemul de intrare / ieșire. BIOS-ul este un soft denumit și firmware care este încorporat în placa de bază și care inițializează hardware-ul computerului pe măsură ce computerul este pornit. După ce inițializează hardware-ul, caută un dispozitiv de boot, cum ar fi o unitate optică sau o unitate de stocare, pentru a porni software-ul, cum ar fi un sistem de operare. Așadar, când porniți computerul, acesta execută un auto-test la pornire sau POST. Acest POST (power on self test) este rulat de BIOS.

Bateria CMOS

[mai mult...]