<?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>openwrt  X-osadminの自留地</title>
	<atom:link href="https://www.x-osadmin.com/category/openwrt/feed" rel="self" type="application/rss+xml" />
	<link>https://www.x-osadmin.com</link>
	<description>- Powered by X-osadmin</description>
	<lastBuildDate>Wed, 03 Nov 2021 07:46:09 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>OpenWrt设置DMZ主机的方法</title>
		<link>https://www.x-osadmin.com/497.xpost</link>
					<comments>https://www.x-osadmin.com/497.xpost#respond</comments>
		
		<dc:creator><![CDATA[xosadmin]]></dc:creator>
		<pubDate>Wed, 03 Nov 2021 07:46:09 +0000</pubDate>
				<category><![CDATA[openwrt]]></category>
		<guid isPermaLink="false">https://www.x-osadmin.com/?p=497</guid>

					<description><![CDATA[OpenWrt是一个开源且十分强大的路由操作系统。部分OpenWrt服务器拥有多于一个的IP地址。这些IP地址可以用于设置DMZ主机，使外网用户能直接访问到内网主机的端口上。在本次，使用OpenWrt的Firewall转发来完成这一操作。话不多说，开整~ 开始之前，假设OpenWrt拥有2个公网IPv4地址，分别为1.2.3.4/29和1.2.3.5/29，且1.2.3.4/29已被主机占用。内网服务器的IP地址为192.168.1.1/24。 在Interfaces设置中，将1.2.3.5/29绑定在wan口上，并保证能联通。 修改Luci/ssh等IP监听配置为仅监听1.2.3.4/29，避免占用端口 在Network -&#62; Firewall -&#62; Custom Rules加入以下内容，并reload整个Firewall即可 iptables -t nat -A PREROUTING -d 1.2.3.5 -j DNAT &#8211;to-destination 192.168.1.1  # 将1.2.3.5的所有traffic转发至192.168.1.1上 iptables -t nat -A POSTROUTING -d 192.168.1.0/24 -j MASQUERADE  # 开启对192.168.1.0/24的钳制NAT转发 经过这样操作，外网可以通过1.2.3.5访问到192.168.1.1上的所有开放的端口。 Enjoy~]]></description>
										<content:encoded><![CDATA[<div class="nc-light-gallery"><p>OpenWrt是一个开源且十分强大的路由操作系统。部分OpenWrt服务器拥有多于一个的IP地址。这些IP地址可以用于设置DMZ主机，使外网用户能直接访问到内网主机的端口上。在本次，使用OpenWrt的Firewall转发来完成这一操作。话不多说，开整~</p>
<p>开始之前，假设OpenWrt拥有2个公网IPv4地址，分别为1.2.3.4/29和1.2.3.5/29，且1.2.3.4/29已被主机占用。内网服务器的IP地址为192.168.1.1/24。</p>
<blockquote>
<ol>
<li>在Interfaces设置中，将1.2.3.5/29绑定在wan口上，并保证能联通。</li>
<li>修改Luci/ssh等IP监听配置为仅监听1.2.3.4/29，避免占用端口</li>
<li>在Network -&gt; Firewall -&gt; Custom Rules加入以下内容，并reload整个Firewall即可</li>
</ol>
<p>iptables -t nat -A PREROUTING -d 1.2.3.5 -j DNAT &#8211;to-destination 192.168.1.1  # 将1.2.3.5的所有traffic转发至192.168.1.1上<br />
iptables -t nat -A POSTROUTING -d 192.168.1.0/24 -j MASQUERADE  # 开启对192.168.1.0/24的钳制NAT转发</p></blockquote>
<p>经过这样操作，外网可以通过1.2.3.5访问到192.168.1.1上的所有开放的端口。</p>
<p>Enjoy~</p>
</div>]]></content:encoded>
					
					<wfw:commentRss>https://www.x-osadmin.com/497.xpost/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>OpenWrt update feeds时提示错误的解决方法</title>
		<link>https://www.x-osadmin.com/492.xpost</link>
					<comments>https://www.x-osadmin.com/492.xpost#respond</comments>
		
		<dc:creator><![CDATA[xosadmin]]></dc:creator>
		<pubDate>Fri, 08 Oct 2021 01:17:38 +0000</pubDate>
				<category><![CDATA[openwrt]]></category>
		<guid isPermaLink="false">https://www.x-osadmin.com/?p=492</guid>

					<description><![CDATA[如题，在一台ubuntu server的机器上尝试编译OpenWrt时，系统提示fatal: unable to access &#8216;https://git.openwrt.org/feed/routing.git/&#8217;: server certificate verification failed. CAfile: none CRLfile: none。这个原因是因为证书引起的。解决方法，即更新证书，很简单，请看下方~ sudo apt update -y sudo apt-get install apt-transport-https ca-certificates -y sudo update-ca-certificates 然后再重新尝试update feeds，一切正常~ &#160; Enjoy~]]></description>
										<content:encoded><![CDATA[<div class="nc-light-gallery"><p>如题，在一台ubuntu server的机器上尝试编译OpenWrt时，系统提示fatal: unable to access &#8216;https://git.openwrt.org/feed/routing.git/&#8217;: server certificate verification failed. CAfile: none CRLfile: none。这个原因是因为证书引起的。解决方法，即更新证书，很简单，请看下方~</p>
<blockquote><p>sudo apt update -y</p>
<p>sudo apt-get install apt-transport-https ca-certificates -y</p>
<p>sudo update-ca-certificates</p></blockquote>
<p>然后再重新尝试update feeds，一切正常~</p>
<p>&nbsp;</p>
<p>Enjoy~</p>
</div>]]></content:encoded>
					
					<wfw:commentRss>https://www.x-osadmin.com/492.xpost/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>OpenWrt编译时产生Undefined reference to ‘pthread_once’的解决方法</title>
		<link>https://www.x-osadmin.com/489.xpost</link>
					<comments>https://www.x-osadmin.com/489.xpost#respond</comments>
		
		<dc:creator><![CDATA[xosadmin]]></dc:creator>
		<pubDate>Thu, 12 Aug 2021 09:29:56 +0000</pubDate>
				<category><![CDATA[openwrt]]></category>
		<guid isPermaLink="false">https://www.x-osadmin.com/?p=489</guid>

					<description><![CDATA[近日在尝试通过自定义的Kernel编译OpenWrt时，出现了如下错误： make[5]: Entering directory &#8216;&#60;working-dir&#62;/build_dir/target-aarch64_generic_musl/linux-layerscape_armv8_64b/linux-5.4.42&#8242; HOSTCC scripts/extract-cert &#60;working-dir&#62;/staging_dir/host/lib/libcrypto.a(libcrypto_la-eng_all.o): In function ENGINE_load_builtin_engines&#8217;: eng_all.c:(.text+0x30): undefined reference to pthread_once&#8217; &#60;working-dir&#62;/staging_dir/host/lib/libcrypto.a(libcrypto_la-err.o): In function ERR_load_ERR_strings&#8217;: err.c:(.text+0xb4e): undefined reference to pthread_once&#8217; &#60;working-dir&#62;/staging_dir/host/lib/libcrypto.a(libcrypto_la-err_all.o): In function ERR_load_crypto_strings&#8217;: err_all.c:(.text+0x9f): undefined reference to pthread_once&#8217; &#60;working-dir&#62;/staging_dir/host/lib/libcrypto.a(libcrypto_la-c_all.o): In function OpenSSL_add_all_ciphers&#8217;: c_all.c:(.text+0x9df): undefined reference to pthread_once&#8217; &#60;working-dir&#62;/staging_dir/host/lib/libcrypto.a(libcrypto_la-c_all.o): In function OpenSSL_add_all_digests&#8217;: c_all.c:(.text+0x9ff): undefined reference to pthread_once&#8217; &#60;working-dir&#62;/staging_dir/host/lib/libcrypto.a(libcrypto_la-crypto_init.o):crypto_init.c:(.text+0x51): more undefined [&#8230;]]]></description>
										<content:encoded><![CDATA[<div class="nc-light-gallery"><p>近日在尝试通过自定义的Kernel编译OpenWrt时，出现了如下错误：</p>
<blockquote><p>make[5]: Entering directory &#8216;&lt;working-dir&gt;/build_dir/target-aarch64_generic_musl/linux-layerscape_armv8_64b/linux-5.4.42&#8242;<br />
HOSTCC scripts/extract-cert<br />
&lt;working-dir&gt;/staging_dir/host/lib/libcrypto.a(libcrypto_la-eng_all.o): In function ENGINE_load_builtin_engines&#8217;: eng_all.c:(.text+0x30): undefined reference to pthread_once&#8217;<br />
&lt;working-dir&gt;/staging_dir/host/lib/libcrypto.a(libcrypto_la-err.o): In function ERR_load_ERR_strings&#8217;: err.c:(.text+0xb4e): undefined reference to pthread_once&#8217;<br />
&lt;working-dir&gt;/staging_dir/host/lib/libcrypto.a(libcrypto_la-err_all.o): In function ERR_load_crypto_strings&#8217;: err_all.c:(.text+0x9f): undefined reference to pthread_once&#8217;<br />
&lt;working-dir&gt;/staging_dir/host/lib/libcrypto.a(libcrypto_la-c_all.o): In function OpenSSL_add_all_ciphers&#8217;: c_all.c:(.text+0x9df): undefined reference to pthread_once&#8217;<br />
&lt;working-dir&gt;/staging_dir/host/lib/libcrypto.a(libcrypto_la-c_all.o): In function OpenSSL_add_all_digests&#8217;: c_all.c:(.text+0x9ff): undefined reference to pthread_once&#8217;<br />
&lt;working-dir&gt;/staging_dir/host/lib/libcrypto.a(libcrypto_la-crypto_init.o):crypto_init.c:(.text+0x51): more undefined references to `pthread_once&#8217; follow<br />
collect2: error: ld returned 1 exit status<br />
scripts/Makefile.host:107: recipe for target &#8216;scripts/extract-cert&#8217; failed<br />
make[6]: *** [scripts/extract-cert] Error 1<br />
Makefile:1105: recipe for target &#8216;scripts&#8217; failed<br />
make[5]: *** [scripts] Error 2</p></blockquote>
<p>一开始是认为是config文件出现问题。尝试重新配置，依旧出现这个问题。通过摸索与搜索，得出以下结果：</p>
<blockquote><p>编辑&lt;openwrt主目录&gt;/build_dir/target-x86_64_musl/linux-x86_64/linux-&lt;版本号&gt;/scripts/Makefile</p>
<p>搜索关键词：HOSTLDLIBS_extract-cert</p>
<p>将原始行注释，并在下方添加如下代码：</p>
<p>[info]HOSTLDLIBS_extract-cert = -lcrypto -lpthread[/info]</p>
<p>重新执行编译即可。</p></blockquote>
<p>Enjoy~</p>
</div>]]></content:encoded>
					
					<wfw:commentRss>https://www.x-osadmin.com/489.xpost/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>OpenWrt做二级路由时无法访问上级路由内网的解决方案</title>
		<link>https://www.x-osadmin.com/474.xpost</link>
					<comments>https://www.x-osadmin.com/474.xpost#respond</comments>
		
		<dc:creator><![CDATA[xosadmin]]></dc:creator>
		<pubDate>Thu, 04 Feb 2021 09:26:31 +0000</pubDate>
				<category><![CDATA[openwrt]]></category>
		<category><![CDATA[技术小絮]]></category>
		<guid isPermaLink="false">https://www.x-osadmin.com/?p=474</guid>

					<description><![CDATA[近日在调试openwrt做为二级路由时遇到了一个问题：当openwrt软路由做为二级路由时无法访问上级路由的内网。经过一番测试，得出原因是来自于路由表配置。解决方法如下： PS: 本文中openwrt内网假设为2.2.2.0/24，openwrt的wan口为静态IP，并被配置为1.1.1.2；上级路由内网假设为1.1.1.0/24，上级路由网关假设为1.1.1.254 首先，在OpenWrt二级路由中配置静态路由表：出接口WAN，目标为1.1.1.0，子关掩码为255.255.255.0，下一跳为上级网关地址，即1.1.1.254 其次，在一级路由中配置静态路由表：出接口LAN，目标为2.2.2.0，子关掩码为255.255.255.0，下一跳为OpenWrt的WAN口地址，即1.1.1.2 在所有配置保存后，正常情况下，上级路由和二级路由的内网会互通，即位于一级路由的用户可以访问2.2.2.0/24，位于openwrt的LAN口用户可以访问1.1.1.0/24 &#160; 农历新年即将到来，在这里X-osadmin提前祝大家新春大吉！]]></description>
										<content:encoded><![CDATA[<div class="nc-light-gallery"><p>近日在调试openwrt做为二级路由时遇到了一个问题：当openwrt软路由做为二级路由时无法访问上级路由的内网。经过一番测试，得出原因是来自于路由表配置。解决方法如下：</p>
<p><span style="color: #ff0000;">PS: 本文中openwrt内网假设为2.2.2.0/24，openwrt的wan口为静态IP，并被配置为1.1.1.2；上级路由内网假设为1.1.1.0/24，上级路由网关假设为1.1.1.254</span></p>
<p>首先，在OpenWrt二级路由中配置静态路由表：出接口WAN，目标为1.1.1.0，子关掩码为255.255.255.0，下一跳为上级网关地址，即1.1.1.254</p>
<p>其次，在一级路由中配置静态路由表：出接口LAN，目标为2.2.2.0，子关掩码为255.255.255.0，下一跳为OpenWrt的WAN口地址，即1.1.1.2</p>
<p>在所有配置保存后，正常情况下，上级路由和二级路由的内网会互通，即位于一级路由的用户可以访问2.2.2.0/24，位于openwrt的LAN口用户可以访问1.1.1.0/24</p>
<p>&nbsp;</p>
<p><span style="color: #ff0000;">农历新年即将到来，在这里X-osadmin提前祝大家新春大吉！</span></p>
</div>]]></content:encoded>
					
					<wfw:commentRss>https://www.x-osadmin.com/474.xpost/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
