After a long time learning about the Linux system, you may encounter a Linux system problem. Here we will introduce how to solve the Linux system problem and configure the network.
1. Modify the host name/etc/sysconfig/network (file)
- NETWORKING=Yes
- NETWORKING_IPV6=No
- NETWORKING_IPV4=Yes
- HOSTNAME=Localhost. Localdomain/* Host Name definition, change localhost to your corresponding host name, such as bea */
- DOMAINNAME=Localdomain
- GATEWAY=192. 168.0.1
In Linux, the/etc/hosts file defines the relationship between the ip address and the host name.) 127.0.0.1 localhost. localdomain localhost/* Change localhost to your host name. For Linux systems such as bea */host name, the file is changed to 127.0.0.1 bea after restart. localdomain bea
2. IP settings
Run the following command to temporarily modify the Linux system: ifconfig eth0 x. x. x. x netmask x. x. x. x does not change if the service is not restarted after the ip address is changed.
The command to restart the network service is:
- Service network restart or/etc/init. d/network restart
- # Sometimes you may need to use the following command
- # Disabling network devices
- Ifconfig eth0 down
- # Enable network devices
- Ifconfig eth0 up
If you want to change the ip address permanently in Linux, you can solve the problem in either of the following two ways. <A> enter a command to configure the ip address. The command is setup <B> or edit the file directly.
- /Etc/sysconfig/network-scripts/ifcfg-ethX Redhat and Fedora)
- /Etc/sysconfig/network/ifcfg-ethX SuSE)
- /Etc/network/interfaces Debian and Ubuntu)
The content of the Linux system file is as follows:
- A. static IP Address:
- DEVICE=Eth0
- BOOTPROTO=Static
- ONBOOT=Yes
- TYPE=Ethernet
- NETMASK=255. 255.255.0
- IPADDR=192. 168.0.1
- GATEWAY=192. 168.0.1
- BROADCAST=192. 168.0.255
-
- b.DHCP:
- DEVICE=eth0
- BOOTPROTO=dhcp
- ONBOOT=yes
- Linux has successfully fixed many bugs.
- Linux system management has won various honors
- Ubuntu Linux systems can be used without any knowledge
- More stable and secure Linux systems
- High-performance servers and monitoring required for Linux System Administrators