In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail about Centos7 installation Squid configuration transparent agent is how, the content of the article is of high quality, so the editor to share with you to do a reference, I hope you have a certain understanding of the relevant knowledge after reading this article.
I. transparent proxy
Transparent proxy provides the same service functions as traditional agents, but its "transparent" implementation depends on default routing and firewall redirection strategy, so it is more suitable for LAN host services than in Internet.
Start configuring transparent proxy server: (the environment is connected to the environment of the previous blog post. If you don't understand, you can refer to the previous post first.)
1. Configure httpd server 1) httpd server adjusts the network card to VM2 network card
[root@centos03 ~] # vim / etc/sysconfig/network-scripts/ifcfg-ens32 TYPE=EthernetPROXY_METHOD=noneBROWSER_ONLY=noBOOTPROTO=staticDEFROUTE=yesNAME=ens32DEVICE=ens32ONBOOT=yesIPADDR=192.168.200.30NATEMASK=255.255.255.0GATEWAY=192.168.200.10 [root@centos03 ~] # systemctl restart network 2, configure Squid Server 1) squid proxy server shuts down and adds VM2 network card to boot
[root@centos02] # cp / etc/sysconfig/network-scripts/ifcfg-ens32 / etc/sysconfig/network-scripts/ifcfg-ens34 [root@centos02 ~] # vim / etc/sysconfig/network-scripts/ifcfg-ens34 TYPE=EthernetPROXY_METHOD=noneBROWSER_ONLY=noBOOTPROTO=staticDEFROUTE=yesNAME=ens34 DEVICE=ens34 ONBOOT=yesIPADDR=192.168.200.10 NATEMASK=255.255.255.0 [root@centos02 ~] # systemctl restart network [root@centos02 ~] # ping 192. 168.200.30 PING 192.168.200.30 (192.168.200.30) 56 (84) bytes of data.64 bytes from 192.168.200.30: icmp_seq=1 ttl=64 time=0.350 ms64 bytes from 192.168.200.30: icmp_seq=2 ttl=64 time=0.564 ms3, Configure Linux client [root@centos01 ~] # vim / etc/sysconfig/network-scripts/ifcfg-ens32 GATEWAY=192.168.100.20 [root@centos01 ~] # systemctl restart network [root@centos02 ~] # vim / etc/sysctl.conf net.ipv4.ip_forward = 1 [root@centos02 ~] # sysctl-p net.ipv4.ip_forward = 1 [root@centos01 ~] # ping 192.168.200.30 PING 192.168.200.30 (192.168.200. 30) 56 (84) bytes of data.64 bytes from 192.168.200.30: icmp_seq=1 ttl=63 time=0.463 ms64 bytes from 192.168.200.30: icmp_seq=2 ttl=63 time=0.484 ms4, Squid server configuration firewall rule [root@centos02 ~] # iptables-F [root@centos02 ~] # iptables-t nat-F [root@centos02 ~] # iptables-t nat-L Chain PREROUTING (policy ACCEPT) target prot opt source destination Chain INPUT (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination Chain POSTROUTING (policy ACCEPT) target prot opt source destination [root@centos02 ~] # iptables-t nat-I PREROUTING-I ens32-s192.168.100.0 to 24-p tcp-- dport 80-j REDIRECT-- to 3128 [root@centos02 ~] # iptables-t nat-I PREROUTING-I ens32-s192.168.100.0b 24-p tcp-- dport 8080-j REDIRECT-- to 3128 [root@centos02 ~] # iptables-t nat-I PREROUTING -I ens32-s 192.168.100.0 dport 24-p tcp-- dport 443-j REDIRECT-- to 3128 [root@centos02 ~] # iptables-t nat-I PREROUTING-I ens32-s 192.168.100.0 tcp 24-p tcp-- dport 21-j REDIRECT-- to 3128 [root@centos02 ~] # iptables-t nat-L Chain PREROUTING (policy ACCEPT) target prot opt source destination REDIRECT tcp-- 192.168.100 .0 24 anywhere tcp dpt:ftp redir ports 3128REDIRECT tcp-192.168.100.0 anywhere tcp dpt:webcache redir ports 3128REDIRECT tcp 24 anywhere tcp dpt:webcache redir ports 3128REDIRECT tcp-192.168.100.0 target 24 anywhere tcp dpt:http redir ports 3128Chain INPUT (policy ACCEPT) Prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination Chain POSTROUTING (policy ACCEPT) target prot opt source destination [root@centos02 ~] # / etc/init.d/squid stop is shutting down squid... [root@centos02 ~] # vim / etc/squid.conf 60 http_port 192.168.100.20: 3128 transparent [root@centos02 ~] # / etc/init.d/squid start is starting squid...5, Windows client uses transparent proxy server 1) windows client network add gateway
2) windows client browser cancels proxy
3) access testing
4) track the access log files of the squid server
6. Linux command line client uses transparent agent [root@centos01 ~] # unset HTTP_PROXY HTTPS_PROXY FTP_PROXY [root@centos01 ~] # elinks http://192.168.200.30 about Centos7 installation Squid configuration transparent proxy is shared here, I hope the above content can be helpful to you, you can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.