proxy 服务器配置

代理服务器,可以通过其来实现防火墙功能与网络浏览数据分析等功能。与iptables不同,防火墙功能也是作用在应用层。Proxy在局域网,对内网和外网均有作用。
在这里插入图片描述

[root@paly ~]#yum install squid
Loaded plugins: fastestmirror
Setting up Install Process
Repository base is listed more than once in the configuration
Loading mirror speeds from cached hostfile
base                                                                              | 3.7 kB     00:00     
epel                                                                              | 4.7 kB     00:00     
extras                                                                            | 3.3 kB     00:00     
updates                                                                           | 3.4 kB     00:00     
Package 7:squid-3.1.23-24.el6.i686 already installed and latest version
Nothing to do

这里写一条将baidu.com ban了的规则。
在这里插入图片描述

[root@paly ~]#vim /etc/squid/mime.conf
[root@paly ~]#id squid
uid=23(squid) gid=23(squid) groups=23(squid),88(wbpriv)
[root@paly ~]#vim /etc/squid/squid.conf
[root@paly ~]#/etc/init.d/squid start
Starting squid: ..                                         [  OK  ]
[root@paly ~]#/etc/init.d/squid restart
Stopping squid: 2022/04/06 01:23:17| WARNING: Could not determine this machines public hostname. Please configure one or set 'visible_hostname'.
2022/04/06 01:23:17| WARNING: Could not determine this machines public hostname. Please configure one or set 'visible_hostname'.
................                                           [  OK  ]
Starting squid: ...                                        [  OK  ]
[root@paly ~]#hostname
paly 
[root@paly ~]#vim /etc/hosts
[root@paly named]#cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.31.224 paly
192.168.1.254 paly
[root@paly named]#
[root@paly ~]#/etc/init.d/squid restart					#重启服务
[root@paly ~]#service iptables stop
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Unloading modules:                               [  OK  ]
[root@paly ~]#vim /etc/squid/squid.conf  
[root@paly ~]#/etc/init.d/squid restart
Stopping squid: ................                           [  OK  ]
Starting squid: .                                          [  OK  ]
[root@paly ~]#vim /etc/squid/squid.conf
[root@paly ~]#/etc/init.d/squid restart
Stopping squid: ................                           [  OK  ]
Starting squid: .                                          [  OK  ]
[root@paly ~]#
[root@paly ~]#netstat -tulnp | grep squid
tcp        0      0 :::3128                     :::*                        LISTEN      21879/(squid)       
udp        0      0 0.0.0.0:46476               0.0.0.0:*                               21879/(squid)       
udp        0      0 :::54449                    :::*                                    21879/(squid)       
[root@paly ~]#

作用于xp

效果
在这里插入图片描述

配置
在这里插入图片描述

作用于win10

配置

在这里插入图片描述
效果
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值