首页 > 代码库 > centos7 use ifconfig command
centos7 use ifconfig command
[1]Default no install ifconfigcommand,if you want to use ifconfig need install net-tools
yum -y install net-tools
[root@mariadb ~]# ifconfig eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.1.123 netmask 255.255.255.0 broadcast 192.168.1.255 inet6 fe80::215:5dff:fe01:a2c prefixlen 64 scopeid 0x20<link> ether 00:15:5d:01:0a:2c txqueuelen 1000 (Ethernet) RX packets 2986228 bytes 4432302967 (4.1 GiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 1541033 bytes 95355497 (90.9 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 0 (Local Loopback) RX packets 112 bytes 10970 (10.7 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 112 bytes 10970 (10.7 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@mariadb ~]# systemctl stop NetworkManager [root@mariadb ~]# systemctl disable NetworkManager rm ‘/etc/systemd/system/multi-user.target.wants/NetworkManager.service‘ rm ‘/etc/systemd/system/dbus-org.freedesktop.NetworkManager.service‘ rm ‘/etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service‘
[2]grub2,对这我不太了解,兴起的是ipv6我用不到,可以禁用掉
vim /etc/default/grub
GRUB_CMDLINE_LINUX="ipv6.disable=1 crashkernel=auto vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos_maria db/swap vconsole.keymap=us rd.lvm.lv=centos_mariadb/root rhgb quiet"
[root@mariadb ~]# grub2-mkconfig -o /boot/grub2/grub.cfg Generating grub configuration file ... Found linux image: /boot/vmlinuz-3.10.0-123.el7.x86_64 Found initrd image: /boot/initramfs-3.10.0-123.el7.x86_64.img Warning: Please don‘t use old title `CentOS Linux, with Linux 3.10.0-123.el7.x86_64‘ for GRUB_DEFAULT, use `Advanced options for CentOS Linux>CentOS Linux, with Linux 3.10.0-123.el7.x86_64‘ (for versions before 2.00) or `gnulinux-advanced-d6e32a08-4535-4ae1-8220-c1f0d51464b3>gnulinux-3.10.0-123.el7.x86_64-advanced-d6e32a08-4535-4ae1-8220-c1f0d51464b3‘ (for 2.00 or later) Found linux image: /boot/vmlinuz-0-rescue-7f8cb19f06a84d6a939e964ca4edcaa7 Found initrd image: /boot/initramfs-0-rescue-7f8cb19f06a84d6a939e964ca4edcaa7.img done
reboot 后生效!
本文出自 “西伯利亚·狼” 博客,请务必保留此出处http://kernal.blog.51cto.com/8136890/1531612
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。