In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
Today, the editor will share with you the relevant knowledge points of CentOS7's network configuration commands, which are detailed and logical. I believe most people still know too much about this, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.
Ip [option] Operand {link | addr | route... }
# # ip link show # display network interface information # # ip link set eth0 upi # enable the network card # # ip link set eth0 down # turn off the network card # # ip link set eth0 promisc on # enable the mixed mode # # ip link set eth0 promisc offi # turn off the mixed mode # # ip link set eth0 txqueuelen 1200 # set the queue length of the network card # # ip link set eth0 mtu 1400 # set the maximum transmission of the network card Unit # # ip addr show # displays the ip information of the network card # # ip addr add 192.168.0.1 ip 24 dev eth0 # sets the eth0 network card ip address 192.168.0.1 dev eth0 # ip addr del 192.168.0.1 dev eth0 # deletes the eth0 network card ip address # # ip route list # View routing information # # ip route add 192.168.4.0 ip route add 24 via 192.168.0.254 dev eth0 # setting The gateway of the 192.168.4.0 network segment is 192.168.0.254 Data goes to eth0 interface # # ip route add default via 192.168.0.254 dev eth0 # set the default gateway to 192.168.0.254 gateway # ip route del 192.168.4.0ax 24 # Delete the gateway # # ip route del default # of the 192.168.4.0 network segment # delete the default route
View network interface information
[root@test ~] # ip link1: lo: mtu 65536 qdisc noqueue state unknown mode defaultlink/loopback 0015 0012 0015 0012 brd 000000 brd 00000000000000000000000000001000000000000VOO: eno16777736: mtu 1500 qdisc pfifo_fast state up mode default qlen 1000link/ether 00:0c:29:e9:5d:7f brd ff:ff:ff:ff:ff:ff
View network card information
[root@test ~] # ip addr1: lo: mtu 65536 qdisc noqueue state unknownlink/loopback 0000 qdisc pfifo_fast state up qlen 1000link/ether 00:0c:29:e9:5d:7f brd ff:ff:ff:ff:ff:ffinet 0000 brd 00:00:00:00:00:00inet 127.0.0.1 scope hostvalid_lft forever preferred_lft forever2 8 scope host lovalid_lft forever preferred_lft foreverinet6:: 1 mtu 1500 qdisc pfifo_fast state up qlen 1000link/ether 00:0c:29:e9:5d:7f brd ff:ff:ff:ff:ff:ffinet 192.168. 23.131/24 brd 192.168.23.255 scope global dynamic eno16777736valid_lft 1383sec preferred_lft 1383secinet6 fe80::20c:29ff:fee9:5d7f/64 scope linkvalid_lft forever preferred_lft forever
View routing tabl
[root@test] # ip route listdefault via 192.168.23.2 dev eno16777736 proto static metric 100192.168.23.0 24 dev eno16777736 proto kernel scope link src 192.168.23.131 metric 100
Add static ip (static)
After installing the default installation, there is no automatic opening of the network connection!
Configuration
Cd / etc/sysconfig/network-scripts/ # enter the network profile directory
Because everyone's name eno16777736 is different, but the prefix is the same, and it's usually the first one in the / etc/sysconfig/network-scripts/ directory.
Vi ifcfg-eno16777736 # Edit the configuration file to add and modify the following
These depend on individual circumstances.
Ipaddr0=192.168.21.128 # set ip address prefixo0=24 # set subnet mask gateway0=192.168.21.2 # set gateway dns1=8.8.8.8 # set primary dns dns2=8.8.4.4 # set standby dns modify bootproto to static bootproto=static # enable static ip address to modify this onboot to yes In this way, your computer can be connected to the network at startup onboot=yes # enable automatic network connection hwaddr=00:0c:29:8d:24:73type=ethernetbootproto=static # enable static ip address defroute=yespeerdns=yespeerroutes=yesipv4_failure_fatal=noipv6init=yesipv6_autoconf=yesipv6_defroute=yesipv6_peerdns=yesipv6_peerroutes=yesipv6_failure_fatal=noname=eno16777736uuid=ae0965e7-22b9-45aa-8ec9-3f0a20a85d11onboot=yes # enable automatic network connection ipaddr0=192.168.21.128 # set ip address prefixo0=24 # set subnet mask gateway0=192.168.21.2 # set gateway dns1=8.8. 8.8 # set primary dnsdns2=8.8.4.4 # set standby dns:wq! # Save exit service network restart # restart network ping www.baidu.com # Test whether the network is working ip addr # check the ip address above is "what are the network configuration commands for CentOS7" Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.
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.