<?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; 某年某月某日-【BD4RPX】</title>
	<atom:link href="https://blog.cnzid.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.cnzid.com</link>
	<description>我是钱锅锅，我无所畏惧，我一生渴望被收藏好，妥善安放，细心保存。免我惊，免我苦，免我四下流离，免我无枝可依。</description>
	<lastBuildDate>Mon, 12 Oct 2026 14:34:12 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.4</generator>

<image>
	<url>https://blog.cnzid.com/wp-content/uploads/2026/01/微信图片_20260113222921_117_461-150x150.jpg</url>
	<title>其他 &#8211; 某年某月某日-【BD4RPX】</title>
	<link>https://blog.cnzid.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">249684443</site>	<item>
		<title>写给父亲的一封信</title>
		<link>https://blog.cnzid.com/2026/10/11/%e5%86%99%e7%bb%99%e7%88%b6%e4%ba%b2%e7%9a%84%e4%b8%80%e5%b0%81%e4%bf%a1/</link>
		
		<dc:creator><![CDATA[]]></dc:creator>
		<pubDate>Sun, 11 Oct 2026 03:45:55 +0000</pubDate>
				<category><![CDATA[其他]]></category>
		<guid isPermaLink="false">https://www.cnzid.com/?p=1990</guid>

					<description><![CDATA[亲爱的爸爸： 今天是2026年10月11日，距离我们正式告别，已经二十二天了。 我这辈子，永远记着两个日子。九 &#8230; <a href="https://blog.cnzid.com/2026/10/11/%e5%86%99%e7%bb%99%e7%88%b6%e4%ba%b2%e7%9a%84%e4%b8%80%e5%b0%81%e4%bf%a1/" class="more-link">继续阅读<span class="screen-reader-text">“写给父亲的一封信”</span></a>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">亲爱的爸爸：</p>



<p class="wp-block-paragraph">今天是2026年10月11日，距离我们正式告别，已经二十二天了。</p>



<p class="wp-block-paragraph">我这辈子，永远记着两个日子。九月七日，是你的生日，也是意外窒息降临的那一天。本该是一家人围坐，为你点上蜡烛，道一声生日快乐，祈愿平安的日子，命运却如此残酷。你长期受NIID病痛困扰，这些年默默硬扛着身体日渐衰退带来的煎熬，很少诉苦，总不愿拖累家人。我们一直陪着你对抗病痛，只盼你能过得轻松些，再多陪我们一段时光。谁也不曾想到，你熬过了漫长的病痛折磨，却在生辰这天遇上突如其来的意外。</p>



<p class="wp-block-paragraph">九月十九日，是我们和你最后的告别。那段日子像一场冰冷沉重的梦，我总恍惚觉得，你只是出门暂离，不久就会回家，还会像从前那样回应我。可环顾家中，物件依旧，却再也寻不到你的身影，我才不得不接受，我永远失去了我的靠山。</p>



<p class="wp-block-paragraph">爸爸，提笔写下这些话，眼泪总会不自觉落下。</p>



<p class="wp-block-paragraph">你和别人不一样，你从来都温柔细腻、懂得表达爱意。你这辈子善良热忱、待人真诚，很会疼爱家人，常常把温柔和关心挂在嘴边，把家里每个人都放在心上。你一辈子勤恳负责，用心经营着我们的家，把所有最好的温柔和偏爱都留给了我们，独自默默扛下身体的病痛和生活的压力。</p>



<p class="wp-block-paragraph">小时候，你是我的英雄，是我全部的底气。长大以后，你依旧时时牵挂我、叮嘱我、疼爱我。哪怕身体日渐受累，被病痛慢慢消耗，你依旧温柔温暖，对家人永远满心柔软。可我还没来得及好好孝敬你，没来得及让你好好享福，来不及好好抱抱你，认真对你说一声谢谢，离别就来得这样仓促。</p>



<p class="wp-block-paragraph">这段日子，我常常发呆，深夜总会想起你。走在路上会下意识寻找你的身影，遇到难处，第一反应还是想和你倾诉。回到安静的家中，再也听不到你的声音。四下寂静，只剩满心空落。原来真正的离别从不是轰轰烈烈的瞬间，而是往后余生，山河依旧，却再也不见你，相逢只能在梦里。</p>



<p class="wp-block-paragraph">爸爸，愿你在天堂一切安好。那里没有NIID，没有日复一日的病痛束缚，也不会再有窒息的痛苦。你终于卸下所有重担与煎熬，可以好好歇息，自在安然，不必再苦苦硬撑。</p>



<p class="wp-block-paragraph">请你放心，我会慢慢学着坚强。从前是你为我遮风挡雨，往后我会独自直面人间风雨。我会好好照顾自己，守护好家里亲人，替你守好这个家，守护所有你牵挂的人。我会带着你的善良、温柔与热爱继续往前走，不辜负你一生的疼爱与付出，把日子慢慢过稳过好，让你在天堂安心。</p>



<p class="wp-block-paragraph">秋意渐浓，天气转凉，天堂的你，记得照顾好自己。</p>



<p class="wp-block-paragraph">往后每一个9月7日，我都会记得，这一天是你的生日，也是我绵长无尽的思念。9月19日，是我们此生的别离。春风夏雨，秋霜冬雪，岁岁无你，岁岁念你。我知道你从未真正离开，化作清风与星光，静静守护着我。</p>



<p class="wp-block-paragraph">此生父子一场，何其有幸；余生遥遥，万般思念，皆寄星河。</p>



<p class="wp-block-paragraph">愿天堂无疾无痛，岁岁安然。</p>



<p class="wp-block-paragraph">永远思念你的孩子</p>



<p class="wp-block-paragraph">2026年10月11日 含泪落笔</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1990</post-id>	</item>
		<item>
		<title>Merry Christmas</title>
		<link>https://blog.cnzid.com/2025/12/24/merry-christmas/</link>
		
		<dc:creator><![CDATA[]]></dc:creator>
		<pubDate>Wed, 24 Dec 2025 15:40:04 +0000</pubDate>
				<category><![CDATA[其他]]></category>
		<guid isPermaLink="false">https://www.cnzid.com/?p=1948</guid>

					<description><![CDATA[祝大家圣诞快乐！]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">祝大家圣诞快乐！</p>



<pre class="wp-block-code"><code>def print_christmas_tree(height=5):
    # 打印圣诞树
    for i in range(height):
        spaces = ' ' * (height - i - 1)
        stars = '*' * (2 * i + 1)
        print(spaces + stars)
    # 打印树干
    trunk_space = ' ' * (height - 1)
    print(trunk_space + '|')

def main():
    print("&#x1f384; Merry Christmas! 圣诞快乐！&#x1f384;\n")
    print_christmas_tree(6)
    print("\n愿你拥有一个温馨、幸福的圣诞节！")

if __name__ == "__main__":
    main()</code></pre>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1948</post-id>	</item>
		<item>
		<title>上云迁移原则</title>
		<link>https://blog.cnzid.com/2025/12/09/%e4%b8%8a%e4%ba%91%e8%bf%81%e7%a7%bb%e5%8e%9f%e5%88%99/</link>
		
		<dc:creator><![CDATA[]]></dc:creator>
		<pubDate>Tue, 09 Dec 2025 04:38:11 +0000</pubDate>
				<category><![CDATA[其他]]></category>
		<guid isPermaLink="false">https://www.cnzid.com/?p=1942</guid>

					<description><![CDATA[评估分析流程]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">评估分析流程</p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="611" src="https://www.cnzid.com/wp-content/uploads/2025/12/ScreenShot_2025-12-09_135436_031-1024x611.png" alt="" class="wp-image-1943" srcset="https://blog.cnzid.com/wp-content/uploads/2025/12/ScreenShot_2025-12-09_135436_031-1024x611.png 1024w, https://blog.cnzid.com/wp-content/uploads/2025/12/ScreenShot_2025-12-09_135436_031-300x179.png 300w, https://blog.cnzid.com/wp-content/uploads/2025/12/ScreenShot_2025-12-09_135436_031-768x458.png 768w, https://blog.cnzid.com/wp-content/uploads/2025/12/ScreenShot_2025-12-09_135436_031-1536x916.png 1536w, https://blog.cnzid.com/wp-content/uploads/2025/12/ScreenShot_2025-12-09_135436_031-1200x716.png 1200w, https://blog.cnzid.com/wp-content/uploads/2025/12/ScreenShot_2025-12-09_135436_031.png 1922w" sizes="(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px" /></figure>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1942</post-id>	</item>
		<item>
		<title>通过GPU压缩视频程序下载</title>
		<link>https://blog.cnzid.com/2025/10/16/%e9%80%9a%e8%bf%87gpu%e5%8e%8b%e7%bc%a9%e8%a7%86%e9%a2%91%e7%a8%8b%e5%ba%8f%e4%b8%8b%e8%bd%bd/</link>
		
		<dc:creator><![CDATA[]]></dc:creator>
		<pubDate>Thu, 16 Oct 2025 03:13:15 +0000</pubDate>
				<category><![CDATA[其他]]></category>
		<guid isPermaLink="false">https://www.cnzid.com/?p=1913</guid>

					<description><![CDATA[給大家推荐一个通过gpu对视频文件进行压缩处理的程序，压缩后的视频在画质上基本无损。（用肉眼看基本上看不出差别 &#8230; <a href="https://blog.cnzid.com/2025/10/16/%e9%80%9a%e8%bf%87gpu%e5%8e%8b%e7%bc%a9%e8%a7%86%e9%a2%91%e7%a8%8b%e5%ba%8f%e4%b8%8b%e8%bd%bd/" class="more-link">继续阅读<span class="screen-reader-text">“通过GPU压缩视频程序下载”</span></a>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">給大家推荐一个通过gpu对视频文件进行压缩处理的程序，压缩后的视频在画质上基本无损。（用肉眼看基本上看不出差别）</p>



<figure class="wp-block-image size-large is-resized"><img decoding="async" width="580" height="1024" src="https://www.cnzid.com/wp-content/uploads/2025/10/Snipaste_2025-10-16_12-18-35-1-580x1024.jpg" alt="" class="wp-image-1915" style="width:630px;height:auto" srcset="https://blog.cnzid.com/wp-content/uploads/2025/10/Snipaste_2025-10-16_12-18-35-1-580x1024.jpg 580w, https://blog.cnzid.com/wp-content/uploads/2025/10/Snipaste_2025-10-16_12-18-35-1-170x300.jpg 170w, https://blog.cnzid.com/wp-content/uploads/2025/10/Snipaste_2025-10-16_12-18-35-1-768x1355.jpg 768w, https://blog.cnzid.com/wp-content/uploads/2025/10/Snipaste_2025-10-16_12-18-35-1.jpg 793w" sizes="(max-width: 580px) 85vw, 580px" /></figure>



<p class="wp-block-paragraph">下载地址如下：</p>



<p class="wp-block-paragraph">通过网盘分享的文件：视频压缩程序文件.rar<br>链接: https://pan.baidu.com/s/1POLZgVYlzL4F2nvxtYd2rg 提取码: kux4</p>



<p class="wp-block-paragraph"></p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1913</post-id>	</item>
		<item>
		<title>蛇年新春快乐</title>
		<link>https://blog.cnzid.com/2025/01/29/%e8%9b%87%e5%b9%b4%e6%96%b0%e6%98%a5%e5%bf%ab%e4%b9%90/</link>
		
		<dc:creator><![CDATA[]]></dc:creator>
		<pubDate>Wed, 29 Jan 2025 03:12:58 +0000</pubDate>
				<category><![CDATA[其他]]></category>
		<guid isPermaLink="false">https://www.cnzid.com/?p=1888</guid>

					<description><![CDATA[蛇年伊始，祝我的朋友们不慌不忙，心之所向，行之所往，终至所归，一路向阳，新年快乐！]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">蛇年伊始，祝我的朋友们不慌不忙，心之所向，行之所往，终至所归，一路向阳，新年快乐！</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="1024" src="https://www.cnzid.com/wp-content/uploads/2025/01/微信图片_20250129115137-1024x1024.jpg" alt="" class="wp-image-1889" srcset="https://blog.cnzid.com/wp-content/uploads/2025/01/微信图片_20250129115137-1024x1024.jpg 1024w, https://blog.cnzid.com/wp-content/uploads/2025/01/微信图片_20250129115137-300x300.jpg 300w, https://blog.cnzid.com/wp-content/uploads/2025/01/微信图片_20250129115137-150x150.jpg 150w, https://blog.cnzid.com/wp-content/uploads/2025/01/微信图片_20250129115137-768x768.jpg 768w, https://blog.cnzid.com/wp-content/uploads/2025/01/微信图片_20250129115137.jpg 1080w" sizes="(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px" /></figure>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1888</post-id>	</item>
		<item>
		<title>Hello，2025</title>
		<link>https://blog.cnzid.com/2025/01/01/hello%ef%bc%8c2025/</link>
		
		<dc:creator><![CDATA[]]></dc:creator>
		<pubDate>Tue, 31 Dec 2024 17:00:00 +0000</pubDate>
				<category><![CDATA[其他]]></category>
		<category><![CDATA[杂文]]></category>
		<guid isPermaLink="false">https://www.cnzid.com/?p=1875</guid>

					<description><![CDATA[告别2024的风雨兼程，迎接2025的灿烂曙光。新的一年，归零、更新、重启，向上，让我们怀揣梦想，勇敢前行，书 &#8230; <a href="https://blog.cnzid.com/2025/01/01/hello%ef%bc%8c2025/" class="more-link">继续阅读<span class="screen-reader-text">“Hello，2025”</span></a>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">告别2024的风雨兼程，迎接2025的灿烂曙光。新的一年，归零、更新、重启，向上，让我们怀揣梦想，勇敢前行，书写属于自己的精彩篇章。</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="576" src="https://www.cnzid.com/wp-content/uploads/2025/01/微信图片_20250102012923-1024x576.jpg" alt="" class="wp-image-1876" srcset="https://blog.cnzid.com/wp-content/uploads/2025/01/微信图片_20250102012923-1024x576.jpg 1024w, https://blog.cnzid.com/wp-content/uploads/2025/01/微信图片_20250102012923-300x169.jpg 300w, https://blog.cnzid.com/wp-content/uploads/2025/01/微信图片_20250102012923-768x432.jpg 768w, https://blog.cnzid.com/wp-content/uploads/2025/01/微信图片_20250102012923-1536x864.jpg 1536w, https://blog.cnzid.com/wp-content/uploads/2025/01/微信图片_20250102012923-2048x1152.jpg 2048w, https://blog.cnzid.com/wp-content/uploads/2025/01/微信图片_20250102012923-1200x675.jpg 1200w" sizes="auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px" /></figure>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1875</post-id>	</item>
		<item>
		<title>Today To Me!</title>
		<link>https://blog.cnzid.com/2024/10/25/today-to-me/</link>
		
		<dc:creator><![CDATA[]]></dc:creator>
		<pubDate>Fri, 25 Oct 2024 04:05:41 +0000</pubDate>
				<category><![CDATA[其他]]></category>
		<guid isPermaLink="false">https://www.cnzid.com/?p=1870</guid>

					<description><![CDATA[愿所有的好运都藏在善良里，做一个温暖的人，不卑不亢，清澈善良的人。]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">愿所有的好运都藏在善良里，做一个温暖的人，不卑不亢，清澈善良的人。</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1870</post-id>	</item>
		<item>
		<title>L2TP/IPsec Server auto install script (CentOS 7)</title>
		<link>https://blog.cnzid.com/2024/04/28/l2tp-ipsec-server-auto-install-script-centos-7/</link>
		
		<dc:creator><![CDATA[]]></dc:creator>
		<pubDate>Sun, 28 Apr 2024 09:56:36 +0000</pubDate>
				<category><![CDATA[其他]]></category>
		<guid isPermaLink="false">https://www.cnzid.com/?p=1818</guid>

					<description><![CDATA[使用方法 1）新建一个名为*.sh的文件(以l2tp-server.sh为例)，填入以下脚本代码。2）导入到C &#8230; <a href="https://blog.cnzid.com/2024/04/28/l2tp-ipsec-server-auto-install-script-centos-7/" class="more-link">继续阅读<span class="screen-reader-text">“L2TP/IPsec Server auto install script (CentOS 7)”</span></a>]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading" id="使用方法">使用方法</h3>



<p class="wp-block-paragraph">1）新建一个名为*.sh的文件(以<code>l2tp-server.sh</code>为例)，填入以下脚本代码。<br>2）导入到CentOS7系统任意目录下，然后执行 <code>sh l2tp-server.sh</code>即可自动配置。</p>



<pre class="wp-block-code"><code>#!/usr/bin/env bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH

cur_dir=`pwd`

rootness(){
    if &#91;&#91; $EUID -ne 0 ]]; then
       echo "Error:This script must be run as root!" 1>&amp;2
       exit 1
    fi
}

tunavailable(){
    if &#91;&#91; ! -e /dev/net/tun ]]; then
        echo "Error:TUN/TAP is not available!" 1>&amp;2
        exit 1
    fi
}

disable_selinux(){
if &#91; -s /etc/selinux/config ] &amp;&amp; grep 'SELINUX=enforcing' /etc/selinux/config; then
    sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
    setenforce 0
fi
}

get_opsy(){
    &#91; -f /etc/redhat-release ] &amp;&amp; awk '{print ($1,$3~/^&#91;0-9]/?$3:$4)}' /etc/redhat-release &amp;&amp; return
    &#91; -f /etc/os-release ] &amp;&amp; awk -F'&#91;= "]' '/PRETTY_NAME/{print $3,$4,$5}' /etc/os-release &amp;&amp; return
    &#91; -f /etc/lsb-release ] &amp;&amp; awk -F'&#91;="]+' '/DESCRIPTION/{print $2}' /etc/lsb-release &amp;&amp; return
}

get_os_info(){
    IP=$( ip addr | egrep -o '&#91;0-9]{1,3}\.&#91;0-9]{1,3}\.&#91;0-9]{1,3}\.&#91;0-9]{1,3}' | egrep -v "^192\.168|^172\.1&#91;6-9]\.|^172\.2&#91;0-9]\.|^172\.3&#91;0-2]\.|^10\.|^127\.|^255\.|^0\." | head -n 1 )
    &#91; -z ${IP} ] &amp;&amp; IP=$( wget -qO- -t1 -T2 myip.ipip.net | egrep -o '&#91;0-9]{1,3}\.&#91;0-9]{1,3}\.&#91;0-9]{1,3}\.&#91;0-9]{1,3}')

    local cname=$( awk -F: '/model name/ {name=$2} END {print name}' /proc/cpuinfo | sed 's/^&#91; \t]*//;s/&#91; \t]*$//' )
    local cores=$( awk -F: '/model name/ {core++} END {print core}' /proc/cpuinfo )
    local freq=$( awk -F: '/cpu MHz/ {freq=$2} END {print freq}' /proc/cpuinfo | sed 's/^&#91; \t]*//;s/&#91; \t]*$//' )
    local tram=$( free -m | awk '/Mem/ {print $2}' )
    local swap=$( free -m | awk '/Swap/ {print $2}' )
    local up=$( awk '{a=$1/86400;b=($1%86400)/3600;c=($1%3600)/60;d=$1%60} {printf("%ddays, %d:%d:%d\n",a,b,c,d)}' /proc/uptime )
    local load=$( w | head -1 | awk -F'load average:' '{print $2}' | sed 's/^&#91; \t]*//;s/&#91; \t]*$//' )
    local opsy=$( get_opsy )
    local arch=$( uname -m )
    local lbit=$( getconf LONG_BIT )
    local host=$( hostname )
    local kern=$( uname -r )

    echo "########## System Information ##########"
    echo 
    echo "CPU model            : ${cname}"
    echo "Number of cores      : ${cores}"
    echo "CPU frequency        : ${freq} MHz"
    echo "Total amount of ram  : ${tram} MB"
    echo "Total amount of swap : ${swap} MB"
    echo "System uptime        : ${up}"
    echo "Load average         : ${load}"
    echo "OS                   : ${opsy}"
    echo "Arch                 : ${arch} (${lbit} Bit)"
    echo "Kernel               : ${kern}"
    echo "Hostname             : ${host}"
    echo "IPv4 address         : ${IP}"
    echo 
    echo "########################################"
}


check_sys(){
    local checkType=$1
    local value=$2

    local release=''
    local systemPackage=''

    if &#91;&#91; -f /etc/redhat-release ]]; then
        release="centos"
        systemPackage="yum"
    elif cat /etc/issue | grep -Eqi "centos|red hat|redhat"; then
        release="centos"
        systemPackage="yum"
    elif cat /proc/version | grep -Eqi "centos|red hat|redhat"; then
        release="centos"
        systemPackage="yum"
    fi

    if &#91;&#91; ${checkType} == "sysRelease" ]]; then
        if &#91; "$value" == "$release" ];then
            return 0
        else
            return 1
        fi
    elif &#91;&#91; ${checkType} == "packageManager" ]]; then
        if &#91; "$value" == "$systemPackage" ];then
            return 0
        else
            return 1
        fi
    fi
}

versionget(){
    if &#91;&#91; -s /etc/redhat-release ]];then
        grep -oE  "&#91;0-9.]+" /etc/redhat-release
    else
        grep -oE  "&#91;0-9.]+" /etc/issue
    fi
}

version_check(){
    if check_sys sysRelease centos;then
        local version="`versionget`"
        local main_ver=${version%%.*}        
        if check_sys packageManager yum; then
            if &#91; "${main_ver}" == "7" ];then
                echo "Current OS version: CentOS ${main_ver} is supported"
                return 0
            else
                echo "Error: CentOS ${main_ver} is not supported, Please re-install OS and try again."
                exit 1
            fi
        fi
    fi
}

preinstall_l2tp(){
    echo
	iprange="192.168.8"
	mypsk="12345678"
	username="test"
	password='test1234'
}

install_l2tp(){

    echo "Adding the EPEL repository..."
    yum -y install epel-release yum-utils
    yum-config-manager --enable epel
    yum -y install ppp libreswan xl2tpd firewalld
    yum_install
}

config_install(){
    cat > /etc/ipsec.conf&lt;&lt;EOF
version 2.0

config setup
    protostack=netkey
    nhelpers=0
    uniqueids=no
    interfaces=%defaultroute
    virtual_private=%v4:10.0.0.0/8,%v4:192.168.0.0/16,%v4:172.16.0.0/12,%v4:!${iprange}.0/24

conn l2tp-psk
    rightsubnet=vhost:%priv
    also=l2tp-psk-nonat

conn l2tp-psk-nonat
    authby=secret
    pfs=no
    auto=add
    keyingtries=3
    rekey=no
    ikelifetime=8h
    keylife=1h
    type=transport
    left=%defaultroute
    leftid=${IP}
    leftprotoport=17/1701
    right=%any
    rightprotoport=17/%any
    dpddelay=40
    dpdtimeout=130
    dpdaction=clear
    sha2-truncbug=yes
EOF

    cat > /etc/ipsec.secrets&lt;&lt;EOF
%any %any : PSK "${mypsk}"
EOF

    cat > /etc/xl2tpd/xl2tpd.conf&lt;&lt;EOF
&#91;global]
port = 1701

&#91;lns default]
ip range = ${iprange}.2-${iprange}.254
local ip = ${iprange}.1
require chap = yes
refuse pap = yes
require authentication = yes
name = l2tpd
ppp debug = yes
pppoptfile = /etc/ppp/options.xl2tpd
length bit = yes
EOF

    cat > /etc/ppp/options.xl2tpd&lt;&lt;EOF
ipcp-accept-local
ipcp-accept-remote
require-mschap-v2
ms-dns 8.8.8.8
ms-dns 8.8.4.4
noccp
auth
hide-password
idle 1800
mtu 1410
mru 1410
nodefaultroute
debug
proxyarp
connect-delay 5000
EOF

    rm -f /etc/ppp/chap-secrets
    cat > /etc/ppp/chap-secrets&lt;&lt;EOF
# Secrets for authentication using CHAP
# client    server    secret    IP addresses
${username}    l2tpd    ${password}       *
EOF

}

yum_install(){

    config_install

    cp -pf /etc/sysctl.conf /etc/sysctl.conf.bak

    echo "# Added by L2TP VPN" >> /etc/sysctl.conf
    echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
    echo "net.ipv4.tcp_syncookies=1" >> /etc/sysctl.conf
    echo "net.ipv4.icmp_echo_ignore_broadcasts=1" >> /etc/sysctl.conf
    echo "net.ipv4.icmp_ignore_bogus_error_responses=1" >> /etc/sysctl.conf

    for each in `ls /proc/sys/net/ipv4/conf/`; do
        echo "net.ipv4.conf.${each}.accept_source_route=0" >> /etc/sysctl.conf
        echo "net.ipv4.conf.${each}.accept_redirects=0" >> /etc/sysctl.conf
        echo "net.ipv4.conf.${each}.send_redirects=0" >> /etc/sysctl.conf
        echo "net.ipv4.conf.${each}.rp_filter=0" >> /etc/sysctl.conf
    done
    sysctl -p

    cat > /etc/firewalld/services/xl2tpd.xml&lt;&lt;EOF
&lt;?xml version="1.0" encoding="utf-8"?>
&lt;service>
  &lt;short>xl2tpd&lt;/short>
  &lt;description>L2TP IPSec&lt;/description>
  &lt;port protocol="udp" port="4500"/>
  &lt;port protocol="udp" port="1701"/>
&lt;/service>
EOF
    chmod 640 /etc/firewalld/services/xl2tpd.xml

    systemctl enable ipsec
    systemctl enable xl2tpd
    systemctl enable firewalld

    systemctl status firewalld > /dev/null 2>&amp;1
    if &#91; $? -eq 0 ]; then
        firewall-cmd --reload
        echo "Checking firewalld status..."
        firewall-cmd --list-all
        echo "add firewalld rules..."
        firewall-cmd --permanent --add-service=ipsec
        firewall-cmd --permanent --add-service=xl2tpd
        firewall-cmd --permanent --add-masquerade
        firewall-cmd --reload
    else
        echo "Firewalld looks like not running, trying to start..."
        systemctl start firewalld
        if &#91; $? -eq 0 ]; then
            echo "Firewalld start successfully..."
            firewall-cmd --reload
            echo "Checking firewalld status..."
            firewall-cmd --list-all
            echo "adding firewalld rules..."
            firewall-cmd --permanent --add-service=ipsec
            firewall-cmd --permanent --add-service=xl2tpd
            firewall-cmd --permanent --add-masquerade
            firewall-cmd --reload
        else
            echo "Failed to start firewalld. please enable udp port 500 4500 1701 manually if necessary."
        fi
    fi

    systemctl restart ipsec
    systemctl restart xl2tpd
    echo "Checking ipsec status..."
    systemctl -a | grep ipsec
    echo "Checking xl2tpd status..."
    systemctl -a | grep xl2tpd
    echo "Checking firewalld status..."
    firewall-cmd --list-all

}

finally(){

    cd ${cur_dir}
    rm -fr ${cur_dir}/l2tp
    # create l2tp command
    cp -f ${cur_dir}/`basename $0` /usr/bin/l2tp

    echo "Please wait a moment..."
    sleep 5
    ipsec verify
    echo
    echo "If there is no &#91;FAILED] above, you can connect to your L2TP "
    echo "VPN Server with the default Username/Password is below:"
    echo
    echo "Server IP: ${IP}"
    echo "PSK      : ${mypsk}"
    echo "Username : ${username}"
    echo "Password : ${password}"
    echo
    echo "Enjoy it!"
    echo
}


l2tp(){
    clear
    echo
    echo "###############################################################"
    echo "# L2TP VPN Auto Installer                                     #"
    echo "# System Supported: CentOS 7+                                 #"
    echo "###############################################################"
    echo
    rootness
    tunavailable
    disable_selinux
    version_check
    get_os_info
    preinstall_l2tp
    install_l2tp
    finally
}

# Main process
l2tp 2>&amp;1 | tee ${cur_dir}/l2tp.log</code></pre>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1818</post-id>	</item>
		<item>
		<title>bind9+namedmanager实现内网DNS UI界面管理</title>
		<link>https://blog.cnzid.com/2022/11/28/bind9namedmanager%e5%ae%9e%e7%8e%b0%e5%86%85%e7%bd%91dns-ui%e7%95%8c%e9%9d%a2%e7%ae%a1%e7%90%86/</link>
		
		<dc:creator><![CDATA[]]></dc:creator>
		<pubDate>Mon, 28 Nov 2022 10:13:36 +0000</pubDate>
				<category><![CDATA[其他]]></category>
		<guid isPermaLink="false">https://www.cnzid.com/?p=1767</guid>

					<description><![CDATA[1、操作系统：centos7.9+bind9+mariadb+namedmanager-v1.9.o 2、修改 &#8230; <a href="https://blog.cnzid.com/2022/11/28/bind9namedmanager%e5%ae%9e%e7%8e%b0%e5%86%85%e7%bd%91dns-ui%e7%95%8c%e9%9d%a2%e7%ae%a1%e7%90%86/" class="more-link">继续阅读<span class="screen-reader-text">“bind9+namedmanager实现内网DNS UI界面管理”</span></a>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">1、操作系统：centos7.9+bind9+mariadb+namedmanager-v1.9.o</p>



<p class="wp-block-paragraph">2、修改yum源</p>



<p class="wp-block-paragraph">cd /etc/yum.repos.d/</p>



<p class="wp-block-paragraph">vim jethrocarr-c7-public.repo</p>



<pre class="wp-block-code"><code># CentOS / RHEL 7 Repositories
#
# www.jethrocarr.com
#

# Packages of third party software that extend the OS and won't replace any
# standard OS or EPEL packages. Generally these are always safe to install
# since they won't override anything else that is present on a system if you're
# only using stock repos.
#
# Some of these packages may require packages in jethrocarr-updates.
&#91;jethrocarr-os]
name=jethrocarr-os
baseurl=https://repos.jethrocarr.com/pub/jethrocarr/linux/centos/7/jethrocarr-os/$basearch/
gpgcheck=1
gpgkey=https://repos.jethrocarr.com/jethrocarr_signing_key.gpg
enabled=1

# Provides upgrades to packages included in the distribution (eg: PHP or the
# kernel). These packages could potentially break other applications you have
# installed onto your computer. Some of these packages may require packages
# in jethrocarr-os.
&#91;jethrocarr-updates]
name=jethrocarr-updates
baseurl=https://repos.jethrocarr.com/pub/jethrocarr/linux/centos/7/jethrocarr-updates/$basearch/
gpgcheck=1
gpgkey=https://repos.jethrocarr.com/jethrocarr_signing_key.gpg
enabled=1

# All RPMs developed by Jethro Carr are located in this repository. Some of
# these programs may require packages in jethrocarr-os or jethrocarr-updates
# in order to install and run
&#91;jethrocarr-custom]
name=jethrocarr-custom
baseurl=https://repos.jethrocarr.com/pub/jethrocarr/linux/centos/7/jethrocarr-custom/$basearch/
gpgcheck=1
gpgkey=https://repos.jethrocarr.com/jethrocarr_signing_key.gpg
enabled=1</code></pre>



<p class="wp-block-paragraph">3、安装软件包</p>



<p class="wp-block-paragraph">yum install -y namedmanager-www namedmanager-bind bind-chroot</p>



<p class="wp-block-paragraph">4、修改配置文件named.conf</p>



<pre class="wp-block-code"><code>vim /etc/named.conf
******************************************************************************************************
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
// See the BIND Administrator's Reference Manual (ARM) for details about the
// configuration located in /usr/share/doc/bind-{version}/Bv9ARM.html
options {
listen-on port 53 { any; };
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
recursing-file "/var/named/data/named.recursing";
secroots-file "/var/named/data/named.secroots";
allow-query { any; };
/* 
- If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.
- If you are building a RECURSIVE (caching) DNS server, you need to enable 
recursion. 
- If your recursive DNS server has a public IP address, you MUST enable access 
control to limit queries to your legitimate users. Failing to do so will
cause your server to become part of large scale DNS amplification 
attacks. Implementing BCP38 within your network would greatly
reduce such attack surface 
*/
recursion yes;
dnssec-enable yes;
dnssec-validation yes;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.root.key";
managed-keys-directory "/var/named/dynamic";
pid-file "/run/named/named.pid";
session-keyfile "/run/named/session.key";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
include "/etc/named.namedmanager.conf";
*********************************************************************
chown named.root /etc/named.namedmanager.conf
chkconfig --level 35 namedmanager_logpush on</code></pre>



<p class="wp-block-paragraph">5、配置数据库</p>



<pre class="wp-block-code"><code>systemctl start mariadb
mysqladmin -u root password 123456
/usr/share/namedmanager/resources/autoinstall.pl</code></pre>



<p class="wp-block-paragraph">6、修改config-bind.php配置文件</p>



<pre class="wp-block-code"><code>vim /etc/namedmanager/config-bind.php
******************************************************************************************************
&lt;?php
/*
Sample Configuration File
Copy this file to config-settings.php
This file should be read-only to the user whom the bind configuration scripts are running as.
*/

/*
API Configuration
*/
$config&#91;"api_url"] = "http://192.168.5.137/namedmanager"; // Application Install Location
$config&#91;"api_server_name"] = "dns.myd.com"; // Name of the DNS server (important: part of the authentication process)
$config&#91;"api_auth_key"] = "dns"; // API authentication key

/*
Log file to find messages from Named. Note that:
* File should be in syslog format
* Named Manager uses tail -f to read it, this can break with logrotate - make sure that either "copytruncate" mode is used, or tail processes are killed
*/
$config&#91;"log_file"] = "/var/log/messages";

/*
Lock File
Used to prevent clashes when multiple instances are accidently run.
*/
$config&#91;"lock_file"] = "/var/lock/namedmanager_lock";


/*
Bind Configuration Files
Theses files define what files that NamedManager will write to. By design, NamedManager does
not write directly into the master named configuration file, but instead into a seporate file
that gets included - which allows custom configuration and zones to be easily added without
worries of them being over written by NamedManager.

*/
$config&#91;"bind"]&#91;"version"] = "9"; // version of bind (currently only 9 is supported, although others may work)
$config&#91;"bind"]&#91;"reload"] = "/usr/sbin/rndc reload"; // command to reload bind config &amp; zonefiles
$config&#91;"bind"]&#91;"config"] = "/etc/named.namedmanager.conf"; // configuration file to write bind config too
$config&#91;"bind"]&#91;"zonefiledir"] = "/var/named/"; // directory to write zonefiles too
// note: if using chroot bind, will often be /var/named/chroot/var/named/
$config&#91;"bind"]&#91;"verify_zone"] = "/usr/sbin/named-checkzone"; // Used to verify each generated zonefile as OK
$config&#91;"bind"]&#91;"verify_config"] = "/usr/sbin/named-checkconf"; // Used to verify generated NamedManager configuration

/*
Unusual Compatibility Options
*/
// Include a full path to the zonefiles in Bind - useful if Bind lacks a
// directory configuration or you really, really to store you zonefiles
// in a different location
//
// $config&#91;"bind"]&#91;"zonefullpath"] = "on";

// force debugging on for all users + scripts
// (note: debugging can be enabled on a per-user basis by an admin via the web interface)
//$_SESSION&#91;"user"]&#91;"debug"] = "on";

?>
****************************************************************************</code></pre>



<p class="wp-block-paragraph">7、启动服务</p>



<pre class="wp-block-code"><code>systemctl start named
systemctl start httpd
hostnamectl set-hostname dns.myd.com</code></pre>



<p class="wp-block-paragraph">8、修改配置php.ini</p>



<p class="wp-block-paragraph">将php.ini文件中的error_reporting = E_ALL改写成error_reporting = E_ALL &amp; ~E_NOTICE（该方法关闭了PHP的提示功能）</p>



<p class="wp-block-paragraph">9、修改apache配置</p>



<pre class="wp-block-code"><code># vi /etc/httpd/conf/httpd.conf
# 这里将 ServerName 改为 192.168.65.123（修改成自己主机的IP地址或者域名）
   ServerName 192.168.65.123

  &lt;Directory />
     AllowOverride none
     #    Require all denied
  &lt;/Directory>

# vi /etc/httpd/conf.d/namedmanager.conf   
  Alias /namedmanager /usr/share/namedmanager/htdocs

  &lt;Location /namedmanager>
        Order allow,deny
        Allow from all
        AllowOverride None
        Require all granted
  &lt;/Location></code></pre>



<p class="wp-block-paragraph">10、登录界面配置DNS服务器</p>



<p class="wp-block-paragraph">web登录http://192.168.65.123/namedmanager/ 默认账号密码setup/setup123</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1767</post-id>	</item>
		<item>
		<title>KVM的网络类型</title>
		<link>https://blog.cnzid.com/2022/07/13/kvm%e7%9a%84%e7%bd%91%e7%bb%9c%e7%b1%bb%e5%9e%8b/</link>
		
		<dc:creator><![CDATA[]]></dc:creator>
		<pubDate>Wed, 13 Jul 2022 08:05:43 +0000</pubDate>
				<category><![CDATA[其他]]></category>
		<guid isPermaLink="false">https://www.cnzid.com/?p=1729</guid>

					<description><![CDATA[KVM的虚拟化网络 1、Linux Bridge 2、vlan 现在的交换机几乎都是支持 VLAN 的。 通常 &#8230; <a href="https://blog.cnzid.com/2022/07/13/kvm%e7%9a%84%e7%bd%91%e7%bb%9c%e7%b1%bb%e5%9e%8b/" class="more-link">继续阅读<span class="screen-reader-text">“KVM的网络类型”</span></a>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">KVM的虚拟化网络 1、Linux Bridge 2、vlan</p>



<p class="wp-block-paragraph">现在的交换机几乎都是支持 VLAN 的。 通常交换机的端口有两种配置模式： Access 和 Trunk。</p>



<p class="wp-block-paragraph">Access 口</p>



<p class="wp-block-paragraph">这些端口被打上了 VLAN 的标签，表明该端口属于哪个 VLAN。 不同 VLAN 用 VLAN ID 来区分，VLAN ID 的 范围是 1-4096。 Access 口都是直接与计算机网卡相连的，这样从该网卡出来的数据包流入 Access 口后就被打上了所在 VLAN 的标签。 Access 口只能属于一个 VLAN。</p>



<p class="wp-block-paragraph">Trunk 口</p>



<p class="wp-block-paragraph">假设有两个交换机 A 和 B。 A 上有 VLAN1（红）、VLAN2（黄）、VLAN3（蓝）；B 上也有 VLAN1、2、3 那如何让 AB 上相同 VLAN 之间能够通信呢？</p>



<p class="wp-block-paragraph">办法是将 A 和 B 连起来，而且连接 A 和 B 的端口要允许 VLAN1、2、3 三个 VLAN 的数据都能够通过。</p>



<p class="wp-block-paragraph">这样的端口就是Trunk口了。 VLAN1、2、3 的数据包在通过 Trunk 口到达对方交换机的过程中始终带着自己的 VLAN 标签。</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1729</post-id>	</item>
	</channel>
</rss>
