CentOS7.5 新装系统如何查看网络,配置网卡信息

2022-11-02 维修技术 0 26
温馨提示丨资源仅供学习交流之用,未经作者授权不可用于商业用途
增值服务:
收费服务
技术支持
远程安装
¥ 1资源分

至尊版免费升级至尊版

开通VIP尊享优惠特权
立即下载 升级会员
详情介绍

环境:

Centos 7.5
戴尔R710本地物理服务器:

CentOS7.5 新装系统如何查看网络,配置网卡信息解决方案:

1.查看ip信息
ip a

ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:50:56:25:19:1c brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.227/24 brd 192.168.1.255 scope global noprefixroute ens33
       valid_lft forever preferred_lft forever
    inet6 fe80::36fd:c3d4:ea0a:5ab4/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever

2.查看编辑网卡信息

vim /etc/sysconfig/network-scripts/ifcfg-em1【注意:em1这个网卡名每个人的不一样,自己查看一下自己的网卡名称】

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=em1
UUID=bf5bb7c5-da27-44a9-b4be-7f6e4138abfd
DEVICE=em1
ONBOOT=yes
IPADDR=192.168.1.227
PREFIX=24
GATEWAY=192.168.1.1

重启网络服务
systemctl restart network

查看em1网卡信息
ifconfig em1

ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.227  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::36fd:c3d4:ea0a:5ab4  prefixlen 64  scopeid 0x20<link>
        ether 00:50:56:25:19:1c  txqueuelen 1000  (Ethernet)
        RX packets 29155875  bytes 2426699185 (2.2 GiB)
        RX errors 0  dropped 108161  overruns 0  frame 0
        TX packets 32605674  bytes 12952561612 (12.0 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

启用em1网卡
ifconfig em1 up

禁用em1网卡
ifconfig em1 down

查看em1网卡其他参数

ethtool em1

Settings for em1:
	Supported ports: [ TP ]
	Supported link modes:   10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Full 
	Supported pause frame use: No
	Supports auto-negotiation: Yes
	Supported FEC modes: Not reported
	Advertised link modes:  10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Full 
	Advertised pause frame use: No
	Advertised auto-negotiation: Yes
	Advertised FEC modes: Not reported
	Speed: 1000Mb/s
	Duplex: Full
	Port: Twisted Pair
	PHYAD: 0
	Transceiver: internal
	Auto-negotiation: on
	MDI-X: off (auto)
	Supports Wake-on: d
	Wake-on: d
	Current message level: 0x00000007 (7)
			       drv probe link
	Link detected: yes

DNS设置
vim /etc/resolv.conf

nameserver 192.168.1.1

关闭NetworkManager服务

systemctl stop  NetworkManager.service

停止开机自启

systemctl disable NetworkManager.service

查看网络服务

systemctl status network.service

● network.service - LSB: Bring up/down networking
   Loaded: loaded (/etc/rc.d/init.d/network; bad; vendor preset: disabled)
   Active: active (running) since 四 2022-03-17 23:58:09 CST; 7h left
     Docs: man:systemd-sysv-generator(8)
  Process: 975 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/network.service
           └─1304 /sbin/dhclient -1 -q -lf /var/lib/dhclient/dhclient-f5774ec4-da78-4594-859b-a17bb015e929-ens33.lease -pf /var/run/dhclient-ens33.pid ens33

3月 17 23:58:06 localhost.localdomain network[975]: 正在打开环回接口: [  确定  ]
3月 17 23:58:07 localhost.localdomain network[975]: 正在打开接口 ens33:
3月 17 23:58:07 localhost.localdomain dhclient[1193]: DHCPREQUEST on ens33 to 255.255.255.255 port 67 (xid=0x2c76a023)
3月 17 23:58:07 localhost.localdomain dhclient[1193]: DHCPACK from 192.168.1.1 (xid=0x2c76a023)
3月 17 23:58:09 localhost.localdomain NET[1300]: /usr/sbin/dhclient-script : updated /etc/resolv.conf
3月 17 23:58:09 localhost.localdomain dhclient[1193]: bound to 192.168.1.227 -- renewal in 10429 seconds.
3月 17 23:58:09 localhost.localdomain network[975]: 正在确定 ens33 的 IP 信息... 完成。
3月 17 23:58:09 localhost.localdomain NET[1350]: /etc/sysconfig/network-scripts/ifup-post : updated /etc/resolv.conf
3月 17 23:58:09 localhost.localdomain network[975]: [  确定  ]
3月 17 23:58:09 localhost.localdomain systemd[1]: Started LSB: Bring up/down networking.

查看网络服务日志

cat /var/log/messages | grep network

ar 17 23:53:00 localhost systemd: Started LSB: Bring up/down networking.
Mar 17 23:54:11 localhost systemd: Stopping LSB: Bring up/down networking...
Mar 17 23:54:12 localhost NET[3314]: /etc/sysconfig/network-scripts/ifdown-post : updated /etc/resolv.conf
Mar 17 23:54:12 localhost network: 正在关闭接口 ens33: [  确定  ]
Mar 17 23:54:12 localhost network: 正在关闭环回接口: [  确定  ]
Mar 17 23:54:12 localhost systemd: Starting LSB: Bring up/down networking...
Mar 17 23:54:12 localhost NET[3516]: /etc/sysconfig/network-scripts/ifup-post : updated 
资源下载此资源下载价格为1资源分,至尊版免费,请先
此资源为本文作者提供有任何疑问请联系本文作者
收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

所有文章均来自网络,或文章作者提供,版权归原作者所有,如有侵权请及时联系本站管理员删除!

京强资源网 维修技术 CentOS7.5 新装系统如何查看网络,配置网卡信息 https://nctcpc.com/jq-1649.html

常见问题
  • 本站所有资源版权均属于原作者所有,这里所提供资源均只能用于参考学习用,请勿直接商用。若由于商用引起版权纠纷,一切责任均由使用者承担。
查看详情
  • 最常见的情况是下载不完整: 可对比下载完压缩包的与网盘上的容量,若小于网盘提示的容量则是这个原因。这是浏览器下载的bug,建议用
查看详情
发表评论
暂无评论