Set the IP address, gateway, and DNS in the command line in LinuxRun the command: ifconfig eth0 192.168.1.123 netmask 255.255.255.0 Run the following command to configure the Gateway: Route add default GW 192.168.1.3 You can write these two commands to/etc/rc. Local or/etc/rc. d/rc. Local to save them permanently.
/Etc/sysconfig/Network: Set the default gateway, host name, and whether to start the network; /Etc/sysconfig/network-script/ifcfg-ethn, N indicates the ID of the NIC. You can set the parameters of the NIC in this area, For example, IP address, netmask, network, broadcast, gateway, and the Protocol (DHCP, static) for obtaining IP addresses at startup are static, Whether to start at startup or not, /Etc/resolv. conf configure the DNS server /Etc/hosts maps the machine name in the LAN with the IP address to access other machines through the machine name (only through If the machine name cannot be used to check the IP address) |