Linux Nic configuration file settings

Source: Internet
Author: User
Linux Nic configuration file settings 1. configuration file www.2cto.com/etc/hosts (the local host IP address ING can have multiple aliases ). /Etc/services (correspondence between Port numbers and standard services ). /Etc/sysconfig/network (set the host name, Gateway ,...
Linux Nic configuration file settings 1. configuration file www.2cto.com/etc/hosts (local host IP address ING, can have multiple aliases ). /Etc/services (correspondence between Port numbers and standard services ). /Etc/sysconfig/network (set the host name, Gateway, and domain name ). HOSTANME = zjw.com (host name) (effective only after the computer is restarted) GATEWAY = 192.168.1.1 (GATEWAY)/etc/rc. d/init. d/network restart (script service startup) service network restart (same as above, it is command execution) 2. related to DNS/etc/host. conf/etc/nsswitch. conf/etc/resolv. conf (configure dns) 3. nic configuration file/etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE = eth0 (which Nic) ONBOOT = yes BOOTPROTO = static (static IP status settings) BOOTPROTO = dhcp (dhcp get) IPADDR = 192.168.1.8 (static IP address) NETMASK = 255.255.255.0 GATEWAY = 192.168.1.1 (Network Off) (if the gateway is set here, the above is invalid) MACADDR = 00: 0C: 29: 96: 38: F8 (modify mac address) (permanently valid)/etc/rc. d/init. d/network restart (script started) service network restart (Command started) 4. the default subnet mask ifconfig eth0 192.168.0.10 will be used for IP address configuration and automatic acquisition. the default subnet mask ifconfig eth0 192.168.0.10 netmask 255.255.255.252 (manually defining the subnet mask) ifconfig eth0 up (activating the NIC) will be used) /etc/sysconfig/network-scripts/ifup eth0 (Script-activated Nic) or ifup eth0 (symbolic link to/sbin/ifup ). Note: It seems invalid to modify the mac address. remember. Ifconfig eth0 down (Nic disabled)/etc/sysconfig/netowrk-scripts/ifdown eth0 (Nic disabled by script) or ifdown eth0 (symbolic link pointing to/sbin/ifdown) netconfig is an IP address setting command in the form of a text window. after modification, use service network restart (for the configuration parameter to take effect) ifconfig eth0-dynamic (manually set to obtain the dhcp IP address) 5. modify the MAC address ifconfig eth0 down ifconfig eth0 hw ether 00: 00: 0c: 12: 34: 56/etc/rd. d/init. d/network (the above changes can be stored in this script) ifconfig eth0 up # The above method is modified in the kernel, you must add the following to the NIC configuration file: MACADDR = 00: 00: 0c: 12: 34: 56/etc/sysconfig/network-scripts/ifcfg-eth0 6. common test commands ping-c 4 172.16.1.1 route (perform operations on the kernel's ip route table, mainly set static routing for the host or network of the configured interface, such as configuring through ifconfig) route add-net 192.168.1.0 netmask route 255.255.0 eth0 (add a route entry to the 192.168.1.0 network) route del-net 192.168.1.0 netmask route 255.255.0 (delete route entries) route-c view buffer table route-n view local route table traceroute route tracking Note: Use netconfig, ifconfig, and route together, without restarting the system and service. 7. create an ADSL connection rpm-qa | grep rp-pppoe rpm-ivh rp-pppoe * (move the disc) route del default (delete the default route) adsl-setup (set the connection) adsl-start (connection test) adsl-status (view status)
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.