centos7.5 虚拟机无法访问网络
1.编辑网络配置文件
cd /etc/sysconfig/network-scripts
vi ifcfg-ens33
2.修改ONBOOT的值为yes
3.wq保存退出
4.reboot重启
1.编辑网络配置文件
cd /etc/sysconfig/network-scripts
vi ifcfg-ens33
2.修改ONBOOT的值为yes
3.wq保存退出
4.reboot重启
1.yum install epel-release
2.yum search mosquitto
3.yum install mosquitto mosquitto-devel
按【Y】
4.service mosquitto start 启动mosquitto服务 报错
Redirecting to /bin/systemctl start mosquitto.service
6.mosquitto_sub -t test1 创建一个主题
7.另外独立开启会话 mosquitto_pub -t test1 -m joyokim
8.最终效果出来了
笔记:
开启防火墙
systemctl start firewalld
关闭防火墙
systemctl stop firewalld
禁用防火墙服务
systemctl make firewalld
添加规则:
firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --permanent --add-port=443/tcp
firewall-cmd --permanent --add-port=22/tcp
firewall-cmd --permanent --add-port=21/tcp
firewall-cmd --permanent --add-port=23560/tcp
firewall-cmd --permanent --add-port=8080/tcp
【旧防火墙机制】
安装iptables
yum -y install iptables-services
开启iptables
systemctl enable iptables