<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>梯子 &#8211; Lhy&#039;s blog</title>
	<atom:link href="https://blog.lhyshome.com/tag/%e6%a2%af%e5%ad%90/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.lhyshome.com</link>
	<description>welcome</description>
	<lastBuildDate>Tue, 18 Jun 2024 08:42:01 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
<site xmlns="com-wordpress:feed-additions:1">219834889</site>	<item>
		<title>内网部署代理服务器</title>
		<link>https://blog.lhyshome.com/2024/05/13/61/</link>
					<comments>https://blog.lhyshome.com/2024/05/13/61/#respond</comments>
		
		<dc:creator><![CDATA[lhy]]></dc:creator>
		<pubDate>Mon, 13 May 2024 03:02:21 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[小技巧]]></category>
		<category><![CDATA[脚本]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[梯子]]></category>
		<guid isPermaLink="false">https://blog.lhyshome.com/?p=61</guid>

					<description><![CDATA[背景：由于内网里需要翻墙的设备或者服务器较多，“梯子”只提供3个连接，且每个设备安装clash不现实，所以单独… <span class="read-more"><a href="https://blog.lhyshome.com/2024/05/13/61/">Read More &#187;</a></span>]]></description>
										<content:encoded><![CDATA[
<p>背景：由于内网里需要翻墙的设备或者服务器较多，“梯子”只提供3个连接，且每个设备安装clash不现实，所以单独做一个服务器安装clash后提供其他内网服务通过代理连接实现“梯子”功能</p>



<p>前提：一台干净的内网服务器，不建议在此服务器上安装其他应用，单独做代理服务器使用</p>



<h2 class="wp-block-heading">docker安装（推荐）</h2>



<h3 class="wp-block-heading">clash后台容器</h3>



<pre class="wp-block-code"><code>docker run -d --name=clash -v "/home/clash:/root/.config/clash/" -p "7890:7890" -p "7891:7891" -p "9090:9090" --restart=unless-stopped dreamacro/clash</code></pre>



<p>执行上述命令启动clash后台容器</p>



<p>将机场配置yaml的内容，复制到/home/clash/config.yaml中</p>



<pre class="wp-block-code"><code>mixed-port: 7890
port: 7890
socks-port: 7891
redir-port: 7892
allow-lan: true
mode: rule
external-controller: '0.0.0.0:9090'</code></pre>



<p><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">注意：allow-lan如果时false，一定要改为true，否则不会将上面的端口代理出来</mark></p>



<p>执行docker restart clash</p>



<p>重启clash容器</p>



<h3 class="wp-block-heading">clash-ui容器</h3>



<pre class="wp-block-code"><code>docker run -p 1234:80 -d --rm --name yacd haishanh/yacd</code></pre>



<p>部署成功后，访问http://ip:1234/，配置clash后台容器9090端口，如下图</p>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="919" height="497" src="https://blog.lhyshome.com/wp-content/uploads/2024/05/image-14.png" alt="" class="wp-image-114" srcset="https://blog.lhyshome.com/wp-content/uploads/2024/05/image-14.png 919w, https://blog.lhyshome.com/wp-content/uploads/2024/05/image-14-300x162.png 300w, https://blog.lhyshome.com/wp-content/uploads/2024/05/image-14-768x415.png 768w, https://blog.lhyshome.com/wp-content/uploads/2024/05/image-14-500x270.png 500w, https://blog.lhyshome.com/wp-content/uploads/2024/05/image-14-800x433.png 800w, https://blog.lhyshome.com/wp-content/uploads/2024/05/image-14-660x357.png 660w" sizes="(max-width: 919px) 100vw, 919px" /></figure>



<p>配置完成后点击进入就可以查看</p>



<h2 class="wp-block-heading">普通安装</h2>



<h3 class="wp-block-heading">处理服务器</h3>



<p>关闭SELinux、firewalld&nbsp;</p>



<pre class="wp-block-code"><code>vim /etc/selinux/config </code></pre>



<p>将 SELINUX=enforcing 改为 SELINUX=disabled，保存后在执行</p>



<pre class="wp-block-code"><code>sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
# 关闭 firewalld&nbsp;
systemctl stop firewalld
systemctl disable --now firewalld</code></pre>



<p>https://github.com/juewuy/ShellClash/blob/master/README_CN.md</p>



<pre class="wp-block-code"><code>export url='https://fastly.jsdelivr.net/gh/juewuy/ShellClash@master' &amp;&amp; wget -q --no-check-certificate -O /tmp/install.sh $url/install.sh  &amp;&amp; bash /tmp/install.sh &amp;&amp; source /etc/profile &amp;&gt; /dev/null</code></pre>



<h3 class="wp-block-heading">开始安装clash</h3>



<h4 class="wp-block-heading" id="二-通过winscp或其他scp客户端手动上传内核单独安装升级内核">通过WinSCP或其他SCP客户端手动上传内核单独安装/升级内核：（此处用的clashpre内核）</h4>



<p>1、参考<strong>↑↑↑识别内核及安装版本↑↑↑</strong>识别内核并下载对应内核文件：</p>



<p>​ Clash内核：https://github.com/Dreamacro/clash/releases</p>



<p>​ Clashpre内核：</p>



<p>​ Clash.meta内核：</p>



<p>​&nbsp;<em><strong>如需要使用vless协议等特殊协议或自定义配置文件功能，需要使用Tun或者混合模式代理UDP流量，请下载Clash.meta内核；否则建议使用Clash内核</strong></em></p>



<p>2、解压为标准二进制文件，通常无须改名，但务必保证文件名同时包含clash与linux两个字母且clash为首字母</p>



<p>3、之后将该文件使用WinSCP或其他SCP客户端上传至/tmp</p>



<p>4、在SSH中直接运行clash命令</p>



<pre class="wp-block-code"><code>clash </code></pre>



<p>5、参考提示完成加载</p>



<p>命令行输入clash 安装完内核、面板，设置开机启动，修改clash功能设置-&gt;切换DNS运行模式 为 fake-ip</p>



<p>面板地址为：http://{内网服务器ip}:9999/ui</p>



<h3 class="wp-block-heading">日常维护</h3>



<p>命令行输入 clash</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.lhyshome.com/2024/05/13/61/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">61</post-id>	</item>
	</channel>
</rss>
