Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the concept of the same network segment of ubuntu?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the relevant knowledge of "what is the concept of the same network segment of ubuntu". The editor shows you the operation process through an actual case, and the operation method is simple, fast and practical. I hope this article "what is the concept of the same network segment of ubuntu" can help you solve the problem.

1.1 same network segment

In many experiments, we will need to use some basic knowledge of local area network. In the process of technical support, we have found a lot of use.

Users are very vague about this concept, resulting in a slight change in the IP address or network environment, it is impossible to achieve the experiment. If

Have not come into contact with this concept, it is recommended to take a good look at this document, it is best to manually calculate and verify whether the two IP addresses are in the

Same network segment.

The concept of "the same network segment" is often used in LAN communication. To understand this concept requires a combination of IP addresses and

Subnet mask.

This article is based on iTOP-4412 development board.

1.1.1 IP address

There are a large number of articles on the network about the theoretical knowledge of IP address.

The main purpose of this paper is to introduce the IP address that needs to be paid attention to in relation to the development board.

As shown in the following figure, using IFconfig, you can view the IP under the Ubuntu system. The IP address of Ubuntu on the surface below is 192.168.0.226.

Before using SSH software and Ubuntu to connect files, you need to check the IP address under Ubuntu first.

Let's take a look at the IP of the development board, as shown in the following figure. You can see that the default IP address is 192.168.1.230 when you look at the etc file of the smallest file system.

The image above shows the smallest system that is not packaged and compiled, such as the figure below, which is the smallest linux system running, and can also be queried and

Modify the IP address.

When the minimum system is running on the development board, you can also use the vi command to change the IP address. 1.1.2 Subnet Mask

The subnet mask is queried in exactly the same way as IP.

As shown in the following figure, using ifconfig, you can view the subnet mask under the Ubuntu system. The following figure shows the Ubuntu's

The subnet mask is 255.255.255.0.

Let's take a look at the subnet mask of the development board, as shown in the following figure, before viewing the etc/eth0-setting file of the smallest file system.

You can see the default subnet mask.

The figure above is the smallest system without packaging and compilation. The following figure shows the smallest linux system running, which can also be queried and modified.

The netmask.

When the minimum system is running on the development board, you can also use the vi command to modify the subnet mask.

2.1 confirm that IP is on the same network segment

This section focuses on how to confirm whether two IP are on the same network segment.

If you calculate and find that the IP of the Ubuntu system and the IP of the development board are not in the same network segment, you need to modify the IP of the development board.

A simple two IP cannot be directly used to confirm whether they are in the same network segment. A conclusion can only be drawn after calculation combined with the subnet mask.

The calculation method is that two IP are respectively calculated with the corresponding subnet mask, and the equality of the result indicates that they are in the same network segment.

Here is a demonstration of the IP and subnet mask in the development board and Ubuntu system in sections 2.1 and 3.1.

The IP and subnet masks of Ubuntu system are 192.168.0.226 and 255.255.255.0, respectively.

The IP address and subnet mask of the development board are 192.168.1.230 and 255.255.255.0, respectively.

The operation and operation need to be converted to binary

Ubuntu system:

IP:11000000 10101000 00000000 11100010

MASK:11111111 11111111 11111111 00000000

Result binary: 11000000 10101000 00000000 00000000

Result hexadecimal: 192.168.0.0

Development board:

IP:11000000 10101000 00000001 11100110

MASK:11111111 11111111 11111111 00000000

Result binary: 11000000 10101000 00000001 00000000

Result hexadecimal: 192.168.1.0

Comparing the above two hexadecimal results, you can see that the IP address in both examples is not on the same network segment. Development

The board needs to modify the IP according to the router or switch.

3.1 modify IP and subnet mask according to the actual situation

As shown in the following figure, the author's router address is 192.168.0.1.

Log in to the router according to the actual situation, and the back of the router

There is usually this address, if you do not check the router manual.

Note that the gateway in the WAN configuration interface above is 192.168.1.1. This is the gateway for the WAN, which is used in the experiment.

It is the gateway of the local area network. You need to select "LAN Port Settings" to find the gateway.

As shown in the following figure, select the DHCP server, and there will be an IP interval in the assigned LAN. In other words, IP can be set up

Set it in the range from 192.168.0.220 to 192.168.0.250.

As shown in the following figure, select "LAN Port Settings" to find the subnet mask of 255.255.255.0.

In addition, in the later NFS file system experiment, we need the above address 192.168.0.1. We can use this address.

The address is regarded as the gateway of the local area network, but not the gateway in WAN!

After knowing the IP address, subnet mask, and viewing the router settings, you can first determine that the subnet mask is

255.255.255.0, then the IP address can be in the range of 192.168.0.220 to 192.168.0.250. Everyone can.

Take an address in this interval to calculate.

Finally, according to your actual situation, after confirming the IP address and MASK address, modify the

Etc/eth0-setting file, set their IP to the same network segment!

This is the end of the introduction of "what is the concept of the same network segment of ubuntu". Thank you for your reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report