NetWork

xiaoxiao2021-03-06  78

V. Manual use command method

Manual use command method is based on Ether

When the NIC has been loaded, edit the configuration file to configure the network. Specific steps are as follows:

(1) Edit /etc/rc.d/rc.local file

Add similar to the following lines in this file:

# Configure the first Ethernet card Eth0

IP address, subnet mask, UP activation

/ sbin / ifconfig, etho 163.1.5.125 Netmask 255.255.0.0 Up

# Configure and activate the loopback device LO

/ sbin / ifconfig LO 127.0.0.1 Up

/ sbin / route add chove 127.0.0.1 lo

# Let Linux send the information of the local network to eth0

interface

/ SBIN / ROUTE ADD CNET 163.1.5.125 Netmask 255.255.0.0 ETH0

# Specify the default access to the remote network

Gateway, assuming the IP address of the default gateway is 163.1.1.254

/ SBIN / ROUTE DEFAULT GW 163.1.1.254 Eth0

(2) Edit /etc/resdv.conf file

This file is the setting name

server. The following is added.

# Specify the native domain name to Linux.net.

Domain linux.net

# Domain Name Server (

DNS), can be a local network or on a remote network. Press NAMSERVER's order # to find one by one. If you are not found, Linux gives up looking for.

Nameserver 163.1.1.4

Nameserver 10.55.0.33

(3) Edit /etc/hosts.conf file

Set the host file table. Can be added as follows:

ORDER HOSTS, BIND

Multi on

163.1.5.125 LGX.Linux.net LGX

The first line indicates that when the name is found, first check the local host file (Hosts), then press the Nameservers order sequence specified by /etc/resolv.conf.

The third line lists the host IP address, host name, and alias.

After editing the three files of /etc/rc.d/rc.local ,/etc/hosts.conf/etc/resolv.conf, the machine must be restarted.

Five, conclude

In summary, as long as any of the methods, the host name, host table, network interface device, and route are used, and the Linux Ethernet is configured to access the Internet and enjoy the service provided by the Internet.

转载请注明原文地址:https://www.9cbs.com/read-107820.html

New Post(0)