ss -tnl 查看所啟動(dòng)的端口 進(jìn)行檢測
基本的網(wǎng)絡(luò)測試工具
[root@tianyun ~]# ip a //查看所有IP
[root@tianyun ~]# ip a s eth0 //查看一個(gè)網(wǎng)卡
[root@tianyun ~]# ip route //查看路由
[root@tianyun ~]# ip neigh //另一臺(tái)主機(jī)ping通
[root@tianyun ~]# hostname //主機(jī)名
[root@tianyun ~]# ping www.baidu.com
[root@tianyun ~]# ping -c2 www.baidu.com
[root@tianyun ~]# ip -s link show eth0 //轉(zhuǎn)發(fā)的數(shù)據(jù)字節(jié)
[root@tianyun ~]# traceroute www.sina.com //跟蹤路由
[root@tianyun ~]# tracepath www.sina.com
已經(jīng)裝好系統(tǒng)CentOS7修改網(wǎng)卡為eth0
- 修改網(wǎng)卡配置文件
[root@localhost ~]# mv /etc/sysconfig/network-scripts/ifcfg-ens33 /etc/sysconfig/network-scripts/ifcfg-eth0
[root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-e
th0
DEVICE=eth0 ?
NAME=eth0??
- GRUB添加kernel參數(shù)
vim /etc/sysconfig/grub
GRUB_CMDLINE_LINUX="...... net.ifnames=0"
3.重新裝載配置文件
grub2-mkconfig -o /boot/grub2/grub.cfg
- reboot
reboot 重啟計(jì)算機(jī)
未裝好系統(tǒng)CentOS7修改網(wǎng)卡為eth0
安裝時(shí)安tab下方出現(xiàn)命令行 加net狠轻。ifnames=0進(jìn)去
初始化服務(wù)器首先要做的幾點(diǎn)
1.為你的服務(wù)器配置root 密碼奸例。
2.配置IP地址
3.配置YUM 源
4.關(guān)防火墻
5.selinux永久和臨時(shí)關(guān)閉防火墻
6.安裝常用程序
7.關(guān)機(jī)快照
可變長子網(wǎng)掩碼
192.168.1.0/24 24個(gè)1 是256-2 一個(gè)網(wǎng)段
192.168.1.0/25 25個(gè)1 是兩網(wǎng)段 只能分為2的次方個(gè)網(wǎng)段