Day8:linux Base slice: Network configuration

Source: Internet
Author: User

Ifconfig: To view information about a network card that has already been activated to use the Ifconfig command, you must install the Net-tools program yum install net-tools-y

    • Eno begins with the representation of the virtual machine NIC
    • ETH for the presentation of the opening for the Real Machine (Ethernet card)
    • Lo is the local loopback network card (data is transferred inside the machine)
    • The MTU 1500 represents the maximum transmission unit of the NIC, which is 1500 bytes, and if the sending data is too large it will be sent in several parts
    • inet 192 .... flag the IP address of the NIC
    • Netmask 255 ... represents a subnet mask
    • Broadcast for broadcast address
    • Either for MAC address
Ifconfig vir ... (NIC name) 192 ... (IP address) netmask 255 .... (Subnet mask): Modify the IP address and subnet mask: Set a virtual network card, its MAC address is not changed: switch off the network card: Activate network card note: The above modification configuration is only a temporary modification, if you want to permanently modify the file, the file exists in/etc Files starting with ifcfg-in the/sysconfig/network-scrpts/directory

Open ifcfg-eno16777736

    • Shows the type of network card, and other details
    • UUID is the identity address of the NIC in the system
    • Bootproto is the IP address obtained by DHCP (dynamic acquisition), if you need to permanently change to their own IP, you need to change DHCP to static (permanent)
    • Modify IP also need to manually add the IP address ipaddr=192 .... (New IP address)
    • Add subnet mask Manually netmask=255 .....
    • Manually add Gateway gateway=192 .... (Same as the root gateway)
    • Manually add DNS dns1=192 .... : DNS1 for first access, you can set a second, third
    • Last set onboot = ' yes ' (activates the NIC at boot)
: CENTOS7 system control State Network: 7 Open Network services: 7 Shutdown Network services: 7 Restart Network services: View gateway and other information 1. If you want to access external Web sites, you first need to parse the URL, modify the parse file, the file path is/etc/ Resolv.conf2. Modify resolv.conf, add resolution nameserver 192 ... (Gateway only) 3. Add a gateway with a command after parsing: Route add default GW 192 ... (gateway address): Add Gateway: Delete Gateway Ping ip/URL: Used to test connectivity to the host the second part can also specify local parsing: Modify the/etc/hosts to directly specify that the address is written directly for the external site, his priority is higher than resolv.conf

Day8:linux Base slice: Network configuration

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.