How to connect XShell and network configuration in CentOS7

How to connect XShell and network configuration in CentOS7

1. Linux network configuration

Before configuring the network, you must first obtain information such as the local IPv4 address and default gateway.

After installing centOS7 and using the setup command, there is no network configuration option. To configure the network, you need to use the nmtui command. Enter the following interface.

Use the arrow keys to select the first item Edit a connection and press Enter to enter the editing interface. The default network card name of CentOS7 is eno16777736. Select Edit and press Enter.

Then add the obtained IPv4 and default gateway information to the corresponding locations. The first three fields of the IPv4 address must be consistent, and the last field can be arbitrary.

Select OK, exit layer by layer, select Quit, and you will be at the command line. Use the nmtui command again, select Activate a connection, activate the connection, and press Enter.

After entering the activation page, select Activate and press Enter. Finally, exit and return to the main page. Run the ifconfig command to view relevant information.

2. Connect to XShell

Open XShell and create a new session. You can name the session anything you want. In the host field, enter the IPv4 address configured in the Linux system, as shown in the figure below.

Then, you can click User Authentication and enter the username and password of the Linux system. (This step is not necessary)

Finally, there is a small issue to note. When connecting to XShell, the local network must be the same as the network used when configuring Linux, otherwise the connection will fail. For example, when configuring, you fill in the home network in Linux, then go out to the company, and connect the local network to the company's wireless network. At this time, you cannot connect to the home network that you just configured.

3. The default network card is automatically started at startup

Sometimes you cannot connect to XShell because the network card in Linux is not turned on. You can use the su command to switch to super user mode, and then use ifup eno16777736 (device network card name) to check. However, the system defaults to manually turning on the network card. When you use it again after shutting down, the network card is still turned off. The solution is as follows:

TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes 
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=eno16777736 
UUID=01974b05 08ec- 4950- af02 bd434293b7bb 
DEVICEeno16777736
ONBOOT=yes 
IPADDR=192.168.1.14 
PREFIX=32
GATEWAY=192.168.1.1
IPV6_ PEERDNS=yes
IPV6_PEERROUTES=yes

1. Enter the directory /etc/sysconfig/network-scripts/

2. Modify the ifcfg-enxxxxxxxx file (the configuration file named after your network card)

3. Change ONBOOT=no to yes

4. Save and restart

The above is the detailed content of how to connect XShell and network configuration in CentOS7. For more information about CentOS7 XShell network configuration, please pay attention to other related articles on 123WORDPRESS.COM!

You may also be interested in:
  • Detailed explanation of the idea of ​​xshell remote login to CentOS7 without password login
  • Centos7 network configuration details
  • CentOS7 network configuration under VMware virtual machine (host wireless Internet access)
  • CentOS7 network configuration tutorial under VirtualBox (can connect to the external network)

<<:  Detailed explanation of the underlying principle of defineCustomElement added in vue3.2

>>:  MySQL concurrency control principle knowledge points

Recommend

HTML head tag meta to achieve refresh redirection

Copy code The code is as follows: <html> &l...

Teach you how to insert 1 million records into MySQL in 6 seconds

1. Idea It only took 6 seconds to insert 1,000,00...

Flex layout makes adaptive pages (syntax and examples)

Introduction to Flex Layout Flex in English means...

Several methods to execute sql files under mysql command line

Table of contents The first method: When the MySQ...

Docker pull image and tag operation pull | tag

I re-read the source code of the Fabric project a...

How to handle concurrent updates of MySQL data

Will UPDATE lock? Will the SQL statement be locke...

40+ Beautiful Web Form Design Examples

Web forms are the primary communication channel b...

Solution to MySQL service 1067 error: modify the mysql executable file path

Today I encountered the MySQL service 1067 error ...

MySQL database deletes duplicate data and only retains one method instance

1. Problem introduction Assume a scenario where a...

vue element el-transfer adds drag function

The Core Asset Management Project requires el-tra...

How to connect to MySQL database using Node-Red

To connect Node-red to the database (mysql), you ...

CSS horizontal progress bar and vertical progress bar implementation code

Sometimes it’s nice to see some nice scroll bar e...

Detailed explanation of MySQL master-slave replication and read-write separation

Table of contents Preface 1. Overview 2. Read-wri...

Adobe Brackets simple use graphic tutorial

Adobe Brackets is an open source, simple and powe...