Configure the network in linux

Source: Internet
Author: User

Configure the network in linux
Configure network 1. Enable Virtual Network

Click Change adapter settings in the left-side Navigation Pane:

Enable Vmware Virtual Network 1 and network 8

2. Set the network type of the VM to bridging mode (important)

Disable the VM, set the network type to bridging mode, and then start the VM.

3. Use the vi editor to configure the Virtual Machine Network

File Path:/etc/sysconfig/network-scripts/ifcfg-eth0: configuration information for the first Nic

After opening the file, the effect is as follows:

DEVICE: DEVICE Name

ONBOOT: After the system starts, whether or not the Nic starts. yes: Start, no: Disable

BOOTPROTO: Network Acquisition Method (automatically obtained by dhcp and manually configured by static)

IPADDR: IP Address

NETMASK: Subnet Mask 255.255.255.0

GATEWAY: Default GATEWAY (associated with vro)

HWADDR: the mac value of the NIC. It is fixed. Each Nic has a unique mac address.

4. Configure the PHP server network

What if I get the Virtual Machine address? A: In the cmd window, run the ping command to ping an IP address. If the IP address cannot be pinged, no other user can use it. Therefore, you can set this network.

Unavailable cases:

Use Cases:

In Linux, the settings are as follows:

Save and exit, and then restart the network through the service, ifup, and ifdown commands.

5. Restart the service command
  • Service network (service name) start | stop | restart | status (recommended)
  • Ifup (dedicated For nic startup)
  • Ifdown (dedicated For nic shutdown)

Example 1: use the service to restart the NIC service

Example 2: Use ifup and ifdown to restart the NIC Service

6. view the NIC address and clear it

In Linux, you can use the ifconfig command to view the network IP address acquisition status.

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.