nokvm被控单ip,想做nat小鸡,现在开通都正常,小鸡不能上网 待解决

AAA000子胜000AAA 1月前 256

按照“单ip搭建挂机宝”设置的,ip地址池如下 教程中的最后一点设置转发:

cd /home/nokvm/resource/ecs-xxx/ cp change.sh modify.sh // 修改过的样例:

cat modify.sh

ncf2=/etc/sysconfig/network-scripts/ifcfg-br0:0 /usr/bin/rm -rf $ncf2 /usr/bin/echo DEVICE=br0:0 >>$ncf2 /usr/bin/echo TYPE=Ethernet >>$ncf2 /usr/bin/echo BOOTPROTO=static >>$ncf2 /usr/bin/echo IPADDR=172.16.0.1 >>$ncf2 /usr/bin/echo NETMASK=255.255.248.0 >>$ncf2 /usr/bin/echo ONBOOT=yes >>$ncf2 systemctl restart network ulimit -n 65535 /usr/bin/echo 'root soft nofile 65535' >> /etc/security/limits.conf /usr/bin/echo 'root hard nofile 65535' >> /etc/security/limits.conf /usr/bin/echo ' soft nofile 65535' >> /etc/security/limits.conf /usr/bin/echo ' hard nofile 65535' >> /etc/security/limits.conf /usr/bin/echo ' soft nproc 65535' >> /etc/security/limits.conf /usr/bin/echo ' hard nproc 65535' >> /etc/security/limits.conf /usr/bin/echo ' soft nofile 65535' >> /etc/security/limits.conf /usr/bin/echo ' hard nofile 65535' >> /etc/security/limits.conf /usr/bin/echo net.ipv4.ip_forward=1 >> /etc/sysctl.conf /usr/sbin/sysctl -p /usr/bin/wget -O /root/iptables-1.4.21-28.el7.x86_64.rpm http://down.tasiyun.com/soft/iptables-1.4.21-28.el7.x86_64.rpm /usr/bin/wget -O /root/iptables-services-1.4.21-28.el7.x86_64.rpm http://down.tasiyun.com/soft/iptables-services-1.4.21-28.el7.x86_64.rpm /usr/bin/rpm -i /root/iptables-1.4.21-28.el7.x86_64.rpm --nodeps /usr/bin/rpm -i /root/iptables-services-1.4.21-28.el7.x86_64.rpm --nodeps systemctl stop firewalld systemctl disable firewalld systemctl enable iptables systemctl start iptables iptables -F iptables -X iptables -Z iptables -I INPUT -p tcp --dport 80 -j ACCEPT iptables -I INPUT -p tcp --dport 8088 -j ACCEPT iptables -I INPUT -p tcp --dport 443 -j ACCEPT iptables -I INPUT -p tcp --dport 22 -j ACCEPT iptables -t nat -A POSTROUTING -s 172.16.0.0/21 -o br0 -j MASQUERADE iptables -A FORWARD -s 172.16.0.0/21 -o br0 -j ACCEPT iptables -A FORWARD -d 172.16.0.0/21 -m state --state ESTABLISHED,RELATED -i br0 -j ACCEPT service iptables save /usr/bin/wget -O /root/nginx-1.16.0-1.el7.ngx.x86_64.rpm http://down.tasiyun.com/soft/nginx-1.16.0-1.el7.ngx.x86_64.rpm /usr/bin/rpm -i /root/nginx-1.16.0-1.el7.ngx.x86_64.rpm --nodeps /usr/bin/rm -rf /etc/nginx/nginx.conf /usr/bin/rm -rf /root/nginx-1.16.0-1.el7.ngx.x86_64.rpm /usr/bin/wget -O /etc/nginx/nginx.conf http://down.tasiyun.com/soft/nginx.conf /usr/bin/systemctl start nginx /usr/bin/systemctl enable nginx 6、在母鸡执行修改过的脚本。

开通小鸡是正常的,分配ip也正常,但小鸡无法联网,映射的端口也连不上,各位老铁帮忙看下,谢谢

最新回复 (0)
返回