Linux ifconfig, route, and ip commands

Source: Internet
Author: User

Linux ifconfig, route, and ip commands I: instructions for use of the three commands; 1: ifconfig can enable/disable Nic interfaces; Set subnet mask and broadcast address; set the mtu of the NIC interface; 2: The route can view routes; add routes; Modify routes; 3; the ip can complete all the functions of ifconfig (ip address) and route (ip route, some additional features are added. I personally feel that ifconfig and route are commonly used in daily use. ip commands are not required for the moment. Here I will introduce how to modify the NIC code and mac address (ip link ); 2. Application of the three commands; 1: Change eth0 address to 192.168.2.49, subnet mask to 255.255.255.0, broadcast address to 192.168.2.255, mtu to 1500; ifconfig eth0 down ifconfig eth0 up ifconfig eth0 192.168.2.149 netmask 255.255.255.255.0 broadcast 192.168.2.255 mtu 1500 2: Use the fastest speed to find the host route; route-n (-n parameter can not be resolved by the host name, when the network is slow, you can quickly see the machine routing situation) 3: delete a route 172.16.0.0/16; add a route 192.168.2.0/24; add a default route gw to 192.168.2.254; route del-net 172.16.0.0 netmask 255.255.0.0 dev eth0 route add-net 192.168.2.0 netmask 255.255.255.0 dev eth0 route add-net 0.0.0.0 netmask 0.0.0.0 gw 192.168.2.254 4 4; change the NIC code of eth0 to WHZ; change the mac address of whzhuang to aa: aa; ip link set eth0 down (disable it first, and then set it to stable) ip link set eth0 name whzhuang (change the eth0 code to whzhuang and remember to change it back later) ip link set whzhuang address aa: aa (set mac address to aa: aa) Description: 1; ip link (mainly set osi Layer 2, data link layer); 2; ip address (mainly set the osi Layer 3, network layer); 3; ip route (mainly set the route); --> however, I feel like ifconfig and route commands are common and used to them, haha.

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.