Linux Basic network Settings

Source: Internet
Author: User



I. Viewing network configuration information


    1. View IP address information

      Ifconfig (View active network configuration information)

      Ifconfig eth0 (view specified NIC information)

      Ifconfig-a (View all network card information)

    2. View routing table information (default gateway)

      Route-n

    3. View Host Name

      Hostname

    4. Test network connectivity

      Ping

    5. Tracking Network nodes

      Traceroute

    6. Test DNS resource records

      Nslookup

    7. Viewing TCP and UDP port information

      Netstat-anptu

      -A: Displays all active network connection information in the current host

      -N: Displays the associated host address in digital form, port information

      -R: Show routing table information

      -L: Display network connection and port information in listening state

      -T: View TCP Information

      -U: Display UDP information

      -P: Shows the process number associated with the network connection, process name information

Two. Setting up network information (temporary)

1. Configure IP address information

Ifconfig eth0 IP Address

Ifconfig eth0:1 IP address (virtual interface)

2. Configure the default gateway

Add route Add default GW gateway address

Delete route del default GW gateway address

3. Modify Host Name

Hostname Host Name

Three. Set up network information (permanent)

    1. Modify the IP address and gateway configuration file

      /etc/sysconfig/network-scripts/ifcfg-eth0

Configuration Item Meaning:

DEVICE: Sets the name of the network interface

Onboot: Set whether the network interface is activated at Linux startup

Bootproto: How to set the network interface (static: Static DHCP: Auto Get)

IPADDR: Set the IP address of the network interface

NETMASK: Subnet Mask

Gaterway: Gateway Address

Configure Restart Network service or Ifdown eth0;ifup eth0 (This is a command)


2. Modify Host Name

/etc/sysconfig/network

Restart the server when you are done changing


3. Configure the NDS server address

/etc/resolv.conf

Add NameServer 202.106.0.20 (one per line)




This article is from the "Carey" blog, make sure to keep this source http://careygg.blog.51cto.com/11084669/1737929

Linux Basic network Settings

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.