In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the relevant knowledge of "how to use fconfig commands in Linux". The editor shows you the operation process through actual cases. The operation method is simple, fast and practical. I hope this article "how to use fconfig commands in Linux" can help you solve the problem.
The Linux ifconfig command is used to display or set up network devices. Ifconfig can set the status of network devices or display current settings.
Command practice 1. Display network card information (1) display active network card information ifconfig
If the network card is turned off, it will not be displayed.
(2) display all the network card information ifconfig-a (3) display the brief information of the network card ifconfig-s (4) display the information of the specified network card ifconfig [network card name] / example: ifconfigenp0s3 (5) network card information explain hrx@@@:~$ ifconfigenp0s3 Link encap:Ethernet HWaddr 08:00:27:bd:61:3c inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255. 0 inet6 addr: fe80::7035:2dfa:8d80:ea7e/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:4 errors:0 dropped:0 overruns:0 frame:0 TX packets:115 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:930 (930.0 B) TX bytes:14560 (14.5 KB) Interrupt:19 Base Address:0xd020lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: 1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:32 errors:0 dropped:0 overruns:0 frame:0 TX packets:32 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes : 2386 (2.3KB) TX bytes:2386 (2.3KB) Nic name: enp0s3, LoLink encap: interface type of network card Ethernet (Ethernet), Local Loopback (local loopback) HWaddr: hardware address of the network card, namely MAC address inet addr:IPv4 address Bcast: broadcast address Mask: subnet mask address inet6 addr:IPv6 address Scope: is used to limit the scope of IPv6 multicast, Host (host local scope), Link (link local scope), Site (site local scope, obsolete), Global (global scope) UP: indicates the network card is up If the network card is closed, it will not be displayed. BROADCAST: indicates that the network card supports broadcast RUNNING: indicates that the network card is running MULTICAST: indicates that the network card supports multicast, but does not display MTU if the network card does not support it. For more information: https://developer.aliyun.com/article/222535Metric: number of hops, usually refers to the number of hops required to reach the destination address, and a hop represents a router. In addition, the higher the hop value, the higher the priority RX line: the total number of packets, errors, discarded, overloaded, and frame TX received by the network card since startup; the total number of packets, errors, discarded, overloaded, frames sent by the network card since startup; the number of overloads, the number of frames collisions: the number of collisions and collisions between packets, which means the network is not very good. Txqueuelen: send queue length RX bytes: number of bytes received TX bytes: number of bytes sent Interrupt:IRQ interrupt address Base address: basic address 2, switch for specified network card
Take the enp0s3 network card as an example. Using ifconfig will not be displayed when the network card is turned off.
/ / activate enp0s3 network card sudo ifconfig enp0s3 up// to turn off enp0s3 network card sudo ifconfig enp0s3 down3 and specify the ARP protocol switch of the network card.
Take the enp0s3 network card as an example. ARP protocol is an address resolution protocol (Address Resolution Protocol). Each host or router maintains an ARP cache table (ARP table), which contains the mapping from IP address to MAC address, and pairs are recorded in the table, so as to realize the query and translation between IP address and MAC address. For more information: https://blog.csdn.net/jiejiemcu/article/details/88406088
/ / start the ARP protocol of the enp0s3 network card sudo ifconfig enp0s3 arp// turn off the ARP protocol sudo ifconfig enp0s3-arp4 of the enp0s3 network card, set the IPv4 address and subnet mask of the network card (temporary)
Take the enp0s3 network card as an example. Subnet mask conversion: 24 is equal to 255.255.255.0, meaning in binary terms, all 24 bits from the left take 1, and the rest are 0. That is 11111111 11111111 11111111 00000000, that is 255.255.255.0
/ modify the IPv4 address of the network card enp0s3, sudo ifconfig enp0s3 10.0.2.16, modify the IPv4 address and subnet mask of the network card enp0s3, method 1, sudo ifconfig enp0s3 10.0.2.16, change the IPv4 address and subnet mask of the network card enp0s3, method 2, sudo ifconfig enp0s3 10.0.2.16 netmask 255.255.255.05, configure the virtual interface of the network card (temporary)
Take the enp0s3 network card as an example. It is equivalent to configuring another IP address for the network card.
Sudo ifconfig enp0s3:0 10.0.2.16/24sudo ifconfig enp0s3:1 10.0.2.17/24sudo ifconfig enp0s3:2 10.0.2.18 sudo ifconfig enp0s3:0 10.0.2.16/24sudo ifconfig enp0s3:1 10.0.2.17/24sudo ifconfig enp0s3:2 246, set the MAC address of the network card (temporary)
Take the enp0s3 network card as an example. Note: the network card down needs to be dropped before it can be set, otherwise it will prompt "SIOCSIFHWADDR: device or resource busy-you may need to down the interface"
/ / modify the MAC address sudo ifconfig enp0s3 hw ether 08:00:27:bd:61:3d7 of the network card and set the maximum transmission unit of the network card (temporary)
Take the enp0s3 network card as an example. The units are bytes.
/ / set the maximum transmission unit sudo ifconfig enp0s3 mtu 14808 of the network card, and add and delete the IPv6 address of the network card
Take the enp0s3 network card as an example.
/ / add the IPv6 address of the network card sudo ifconfig enp0s3 add fe80::7035:2dfa:8d80:ea7d/64// delete the IPv6 address of the network card sudo ifconfig enp0s3 del fe80::7035:2dfa:8d80:ea7d/64 on "how to use the fconfig command in Linux", thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.