DgitalOcean centos7+ss+Proxifiersh实现校园网免ipv4

来源:互联网 发布:sql identity 不跳 编辑:程序博客网 时间:2024/05/20 03:37

首先保证电脑有 IPV6地址


GIthub有教育优惠券  50$


1.DgitalOcean 申请一个服务器  一个月5$  (发邮件到你的邮箱)


2.用 xshell或者putty 登陆


 3修改password


4.安装ss


5.

  1. {  
  2.  "server":"my_server_ip",  
  3.  "local_address""127.0.0.1",  
  4.  "local_port":1080,  
  5.   "port_password": {  
  6.      "8381""foobar1",  
  7.      "8382""foobar2",  
  8.      "8383""foobar3",  
  9.      "8384""foobar4"  
  10.  },  
  11.  "timeout":300,  
  12.  "method":"aes-256-cfb",  
  13.  "fast_open"false  

6.

centos默认的防火墙机制,会阻隔掉我们的多端口配置。所以,解决方法就是,将这个端口打开tcp和udp通信。这里需要说明的事,在centos版本的更新迭代过程中,centos7和centos6之间的差异性较大。在centos7,采用的是最新的防火墙filewall而不是传统的iptables。所以,为了更加合理的提供端口号解决方案,我这里提供两种方法,个人推荐第2种。

     第一种:

     具体操作为:iptables -A INPUT -p tcp –dport 443 -j ACCEPT。//443为示例端口,你可以改为你需要的。

     然后重启防火墙:service iptables restart。这个时候我们可以再通过netstat -antu 查看一下,就会发现那个端口能够正常工作了。然后就可以科学上网啦。

     第二种:

     具体操作为,先进入firewalled的配置端口目录,路径为etc/firewalled/zones/。打开public.xml文件进行端口的编辑,例如 <port protocol="tcp" port="449"/>   <portprotocol="udp" port="443"/>。即添加了tcp和udp的权限。

启动一个服务:systemctl start firewalld.service
关闭一个服务:systemctl stop firewalld.service
重启一个服务:systemctl restart firewalld.service
显示一个服务的状态:systemctl status firewalld.service
在开机时启用一个服务:systemctl enable firewalld.service
在开机时禁用一个服务:systemctl disable firewalld.service
查看服务是否开机启动:systemctl is-enabled firewalld.service
查看已启动的服务列表:systemctl list-unit-files|grep enabled
查看启动失败的服务列表:systemctl --failed

0 0
原创粉丝点击