Ifconfig of network configuration and detailed description of IP commands

Source: Internet
Author: User
Tags nameserver

    • Ipconfig

    • -A shows the configuration of all interfaces

    • Ifconfig eth0 display configuration of eth0

      • Ifconfig eht0 ip/mask[up|down]\

The configured address takes effect immediately, but fails to restart the Network service or host



Network Services

RHEL5:/etc/init.d/network {start|stop|restasrt|status}

RHEL6:/etc/init.d/networkmanager | {Start|stop|restasrt|status}

    • Note: {Start|stop|restasrt|status} is a parameter

Gateway:

Route routing

Route add: Add route

-host: Adding host routes

-net: Adding network routes

-net 0.0.0.0 Add a default route

Liezi:

Route Add-net | -host DEST GW Nexthop

Route add default GW nexthop

Route del: Delete route

-host

-net

Liezi:

Route Del-net 10.0.0.0/8

Route Del-net 0.0.0.0

Routel del Default

Note: The route command looks at the native routing table

Route-n Digital display of information about each host or port

Note: Changes made to restart the Network service or host after the failure

Network configuration file:

[Email protected] ~]# cat/etc/sysconfig/network

Network Interface configuration file:

[Email protected] ~]# Cat/etc/sysconfig/network-scripts/ifcfg-eth0

The configuration file is as follows:

[Email protected] ~]# cd/etc/sysconfig/network-scripts/[[email protected] network-scripts]# cat Ifcfg-eth0
IPADDR=:IP address netmask=: Subnet mask gateway=: Set default gateway Userctl={yes | No}: Allow normal user to control this interface Peerdns={yes | NO}: The DNS address specified by the DHCP server is accepted when Bootproto is DHCP; [email protected] network-scripts]#

Note: Changing the configuration in the configuration file will not take effect immediately, but restarting the network service or host will take effect;

Restart Network Service:

[Email protected] network-scripts]#/etc/init.d/network restart

The DNS server specifies only one method:

[Email protected] ~]# cat/etc/resolv.conf

nameserver dns_ip_1

NameServer dns_ip_2

This article is from the "Linux Operations Technology Exchange" blog, please be sure to keep this source http://linuxzhang.blog.51cto.com/2580498/1673924

Ifconfig of network configuration and detailed description of IP commands

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.