1. 手动分区
1 | /boot for 200m ext4 |
2. IP addr
1 | ifconfig not found |
CentOS 7 minimal systems, use the commands “ip addr” and “ip link” to find the details of a network interface card. To know the statistics use “ip -s link”.
Install ifconfig
1 | yum provides ifconfig |
Mind: BOTH ifconfig and netstat is obsolete, use ip and ss instead.
3. 配置静态IP地址
- 查看网络管理器服务的状态:
1 | [root@localhost network-scripts]# systemctl status NetworkManager.service |
- 查看网络管理器管理的网络接口: (for eno167 is our goal)
1 | [root@localhost network-scripts]# nmcli dev status |
- 修改配置文件
1 | vim /etc/sysconfig/network-scripts/eno16777736 |
1 | *BOOTPROTO="static" |
- 重启网络服务:
1 | systemctl restart network.service |
- ping connect: Network is unreachable
1 | ping -c 4 192.168.1.9 |
用指令dhclient來與DHCP連線:
1 | $ dhclient |
yum “Couldn’t resolve host ‘mirrorlist.centos.org’” for CentOS 6
1
2
3
4
5# vim /etc/resolv.conf
And append:
nameserver 8.8.8.8 nameserver 8.8.4.4 nameserver 127.0.0.1If still failed to connect outer network:
1
2
3
4
5
6
7
8
9/etc/sysconfig/network:
NETWORKING=yes
HOSTNAME=centos7
GATEWAY=10.0.0.1
/etc/resolv.conf:
nameserver 8.8.8.8
nameserver 8.8.4.4Destination unreachable / No route to host / 断网等各种事件
因为VM ware Bridge 模式无法使用,在虚拟机网络编辑器里重置默认值,然后在win10宿主机中为VM net的属性中选上Bridge protocol.
究极大法:Shutdown all VMs, Reboot Host, Reset VMware adapter, Boot VMs, Shutdown firewall
4. Install lrzsz Error
1 | Error downloading packages: lrzsz-0.12.20-36.el7.x86_64: [Errno 256] No more mirrors to try. |
Try this:
1 | $ yum clean all |
and dhclient if necessary
5. 防火墙问题
Visit tomcat at http://192.168.1.15:8080/ failed.
Caused by firewall, stop or disable it:
1 | $ systemctl stop firewalld.service |
OR1
2
3[root@localhost ~]# systemctl disable firewalld.service
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
OR 允许8080端口流量通过
1 | firewall-cmd --zone= --add-port=8080/tcp --permanent |
参考:
1 | firewall-cmd --state # 检查防火墙状态 |
6. Hostname 修改
1 | [root@localhost ~]# hostnamectl set-hostname master15 |
查看结果(静态、瞬态和灵活主机名):
1 | $ hostnamectl status |
注意
对于静态/瞬态主机名,任何特殊字符或空格都会被移除,字母转小字。修改静态主机名,/etc/hostname 将被自动更新。但/etc/hosts需要手动更新。
7. User and SSH
Initial new server by new user and SSH:
New Server Initial
8. Configuring Basic Firewall
Start up firewalld:1
sudo systemctl start firewalld
Allow SSH with default port:1
sudo firewall-cmd --permanent --add-service=ssh
Timezone config:1
2
3
4
5sudo timedatectl
sudo timedatectl set-timezone Asia/Shanghai
ntpdate time.windows.com
hwclock -w