今天遇到一台非常神奇的设备, CPU 是两颗 E5-2682 v4, 256G DDR4 内存, 主版标识是 Bba88-BBAC612 3.2. 原机已安装 VMWare ESXi. 想着安装 PVE9 之后和已有的一台机器组个集群, 但是安装系统的过程中遇到了 Proxmox USB 安装盘无法被 BIOS 识别的问题.

安装盘使用 32G USB, 通过 Rufus DD模式烧录 Proxmox 9.2 ISO. 启动后 Boot Option 里找不到USB设备, 进入 UEFI Shell, 运行 map -r 命令能看到 Removable BlockDevice 显示为 blk8 但是没有 fs0 或 fs1 这样的 alias. 直接 blk8: 之后 ls 也是无法运行的, 提示找不到文件. 后来换了一块16G的U盘也不行.

尝试在 BIOS 设置中关闭 Secure Boot, 调整 CSM, XHCI Handoff, EHCI Handoff, 都没有效果. UEFI Hard Disk Drive BBS Priorities 中只能看到 UEFI OS 和 VMware ESXi. 尝试关闭 VMWare ESXi 之后也没有效果.

搜索了一下发现这台机器有 IMPI/BMC, 管理口插上网线之后能打开 web 页面, 但是没有登录密码. 尝试了很多热门的用户名密码组合均失败, 热门用户名尝试重置密码也没成功.

看资料显示如果能进入系统的话, 可以从系统中重置IMPI密码, 于是用U盘制作了一个 Debian Live USB, 启动后运行 modprobe ipmi_si, modprobe ipmi_devintf, 但是加载 ipmi_si 的时候报错: ipmi_si: Unable to find any System Interface(s), 并且 /dev 下没有 impi0 类似的设备. 推断可能是主板通过某种方式关闭了这种重置路径.

不过因为意外发现 Debian Live USB 可以被正常识别和启动, 尝试通过 Debian 启动 Proxmox.

首先启动Debian, 进系统之后 sudo -i 提权, apt update && apt install kexec-tools 安装 kexec (需要联网)

lsblk 后找到类似 sda, sdb 的设备, 通过 blkid /dev/sdb 确认是否包含 TYPE="iso9660" LABEL="PVE" 字样.

1
2
3
mkdir /mnt/pve
mount -t iso9660 -o ro /dev/sdb /mnt/pve
ls -al /mnt/pve/boot

此时能看到 linux26, initrd.img 文件

运行

1
2
3
4
5
kexec -l /mnt/pve/boot/linux26 \
--initrd=/mnt/pve/boot/initrd.img \
--command-line="ro ramdisk_size=16777216 rw splash=verbose proxdebug proxtui"
sync
kexec -e

屏幕黑了一下然后重新亮了, 但是没有任何内容显示. 等待了大约5分钟也没有反应, hard reset.

第二次尝试

1
2
3
4
5
kexec -l /mnt/pve/boot/linux26 \
--initrd=/mnt/pve/boot/initrd.img \
--command-line="ro ramdisk_size=16777216 rw splash=verbose nomodeset proxdebug proxtui console=tty0"
sync
kexec -e

屏幕黑了之后没有亮起来, 等待5分钟后也没有反应, hard reset.

然后尝试通过 Debian Live 的 Grub 启动 Proxmox, 首先启动到 Debian Live 的启动界面, 按 c 打开 grub> 引导界面.

在 grub 中输入

1
2
3
4
5
6
insmod part_gpt
insmod part_msdos
insmod iso9660

search --file --set=pve ./.pve-cd-id.txt
echo $pve

显示 hd0

1
2
ls ($pve)/
ls ($pve)/boot/

能看到 linux26, initrd.img 文件, 接下来在 grub 中继续输入

1
2
3
4
set root=$pve
linux /boot/linux26 ro ramdisk_size=16777216 rw splash=verbose proxdebug proxtui nomodeset
initrd /boot/initrd.img
boot

成功进入 Proxmox Terminal UI Installer. 不过在安装前, 安装刚开始和安装完成后会进入 Debug Shell, 此时只要输入 exit 即可继续流程.

安装

strongswan 老版本和新版本不同, 老版本是基于 /etc/ipsec.conf 配置的, 而新版本是基于 /etc/swanctl/swanctl.conf, /etc/swanctl/conf.d/ 进行配置的. 配置文件语法不一样. 本文主要关注新配置的使用.

删除旧版本: sudo apt install strongswan-starter strongswan-charon (如果你不小心 sudo apt install strongswan 的话)

安装新版本: sudo apt install charon-systemd strongswan-swanctl

配置

某地的公司办公室, 通过IPsec连接到另一地区的办公室.

/etc/swanctl/conf.d/office-tunnel.conf

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
connections {
office-tunnel {
version = 2
encap = yes
mobike = yes # this site is behind NAT
keyingtries = 0 # this site is behind NAT

rekey_time = 86100s
rand_time = 3m
over_time = 300s
local_addrs = 192.168.1.3
remote_addrs = <RemoteIP>

proposals = aes256gcm-prfsha512-modp4096

local {
auth = psk
id = 192.168.1.3
}

remote {
auth = psk
id = <RemoteIP>
}

children {
net-net {
local_ts = 0.0.0.0/0
remote_ts = 0.0.0.0/0
esp_proposals = aes256gcm16-modp8192
start_action = trap|start
close_action = start
dpd_action = restart
mode = tunnel
if_id_in = 42
if_id_out = 42
rekey_time = 42900s
rand_time = 3m
life_time = 43200s
replay_window = 4096
}
}
}
}

secrets {
ike-psk {
id-1 = 192.168.1.3
id-2 = <RemoteIP>
secret = "..."
}
}

需要注意的点:

名字 office-tunnel, net-net, ike-psk 虽然是可以自己随意取, 但是是全局唯一的, 也就是说在本机的所有配置文件中只能出现1次. 并不存在 office-tunnel-1 下面的 net-net 和 office-tunnel-2 下面的 net-net 是不同的情况.

start_action = start 如果不配置这个, 隧道不会被自动拉起. trap 的含义是当有流量尝试走这个隧道的时候也触发一次主动握手.

close_action = start 如果不配置这个, 当对端主动发起CLOSE之后(或者断网了!!!), 隧道不会被自动拉起.

dpd_action = restart 如果不配置这个, DPD(Dead Peer Detection)检测触发掉线之后, 隧道不会被自动拉起.

(不是很懂为什么 IPsec/Strongswan 要这么设计… 非常诡异啊, 默认都是不拉起隧道…)

version = 2 表示我们在使用 IKEv2. 不写默认是 IKEv1.

mobike = yes 本端在NAT后, 启用 IKEv2 Mobility and Multihoming Protocol. 主要作用是当网络地址发生变化时尽量保持现有的IKE/IPsec SA. 当地址变化了的时候, 可以通过本协议更新对端地址. 需要双方都支持 MOBIKE.

keyingtries = 0 表示 IKE/IPsec 协商失败后无限重试, 不限制重试次数. (这也很诡异, 什么情况下会不重试啊= =)

children/net-net 里面, replay-window = 4096 配置 IPsec ESP 的抗重放窗口大小为 4096 个包. 允许最近的 4096 个包乱序但尚未收到过. 主要用于增加吞吐量, 底层网络有抖动时, 或底层网络包会乱序时重传窗口能够防止因为乱序而丢弃ipsec包.

“一滴一滴刺痛我的心”-0.98x《梦的翅膀受了伤》 | 梦的翅膀受了伤(DJ阿智版)-蒋雪儿 KTV-火遍全网的循环播放洗脑神曲!

“坦坦荡荡/颤颤巍巍见自己.”|《琵琶行dj》降调

T-ARA (티아라) Lovey Dovey Color Coded Lyrics (Han/Rom/Eng)

念张师(citypop remix) 豪 俊 金 曲

LXNGVX - Montagem Mysterious Game (PHONK)

MONTAGEM TENTA (Slowed)

pupsies - misery. (Lyrics) Minecraft小视频经典配乐

GNAB x CINNAMONA - TÚC DUYÊN

“举起你左手!”《爆了》dj DJ阿杰

“画外人易朽 似浓淡相间色相构.”|《吹梦到西洲dj》0.88x | 循环歌单|《野生狗奶の小曲》吹梦到西洲DJ | 吹梦到西洲 0.8X (降调DJ抖音版2025 ProgHouse) Xuy Mộng Đáo Tây Châu (Slow Remix Tiktok 2025) - 黄诗扶 & 王敬轩(妖扬) | 吹梦到西洲 (抖音DJ阿乐版 2025) Xuy Mộng Đáo Tây Châu (Remix Tiktok 2025) - 黄诗扶 & 王敬轩(妖扬)

【杜比音效】庄心妍《以后的以后》4K「没有我以后 一个人少喝点酒」动态歌词

电棍:游京

Malaysia No.1 马来西亚1号 (DJ抖音版 Remix Tiktok 2026) || Proghouse Mix Hot Douyin | Malaysia No. 3

《清明上河图DJ》工业小曲,仿佛隔空变换到那里! 天才交易员 光刻机的小曲 加仓小曲

天才交易员的小曲 | “醉卧于沙场 听呐喊的沙哑.”|《真英雄dj》0.8x 循环 | 天才交易员の小曲 小曲精选

Sacred Play Secret Place V2 Remix | 飞驰人生进行曲DJ 2026 - DJ抖音版 Remix | Hot TikTok - Douyin

“人间琴悠扬 姑娘把谁记心上.”|《琵琶曲dj》1.15x

“十年寒窗无人晓 儿郎志气高.”|《八千里路明月照dj》降调

往期优秀作品推荐

2026年5月

默认情况下, 安装 Debian 13 时如果启用了 Network Mirror, 会开始自动下载软件更新. 某些情况下我们希望尽快完成系统的安装, 此时可以进行如下操作:

在启动界面, 选择 Graphic Install 前, 按下 TAB 键, 在下方会出现一行启动引导参数, 在末尾添加 pkgsel/upgrade=none 后按下回车, 进入到后面的 Network Mirror 环节时继续选择 Yes, 此时会跳过自动更新, 且 apt sources.list 也会被正确配置. (如果选 No 的话, 安装完成之后还需要手动补, 比较头疼)

当然更好的办法是写一个 preconfiguration, 然后让 debian 执行全自动安装. 在配置里也有这一项:

1
2
3
# Whether to upgrade packages after debootstrap.
# Allowed values: none, safe-upgrade, full-upgrade
#d-i pkgsel/upgrade select none

参考

PSA: You want to “Use a network mirror” for Debian 12.0.0 installation

B.4. Contents of the preconfiguration file (for trixie)

卸载VMware之后,原来的VM内部还保留着VMWare Tools,每次开机的时候客户机系统会报错.

  1. 优选方式是在卸载VMWare前先打开客户机系统, 卸载对应的VMWare Tools.

  2. 如果已经卸载了VMWare Workstation, 可以在客户机系统内运行下面这个脚本, 运行后重启客户机系统即可.

remove_vmware_tools.ps1 以管理员身份运行

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# This script will manually rip out all VMware Tools registry entries and files for Windows 2008-2019
# Tested for 2019, 2016, and probably works on 2012 R2 after the 2016 fixes.

# This function pulls out the common ID used for most of the VMware registry entries along with the ID
# associated with the MSI for VMware Tools.
function Get-VMwareToolsInstallerID {
foreach ($item in $(Get-ChildItem Registry::HKEY_CLASSES_ROOT\Installer\Products)) {
If ($item.GetValue('ProductName') -eq 'VMware Tools') {
return @{
reg_id = $item.PSChildName;
msi_id = [Regex]::Match($item.GetValue('ProductIcon'), '(?<={)(.*?)(?=})') | Select-Object -ExpandProperty Value
}
}
}
}

$vmware_tools_ids = Get-VMwareToolsInstallerID

# Targets we can hit with the common registry ID from $vmware_tools_ids.reg_id
$reg_targets = @(
"Registry::HKEY_CLASSES_ROOT\Installer\Features\",
"Registry::HKEY_CLASSES_ROOT\Installer\Products\",
"HKLM:\SOFTWARE\Classes\Installer\Features\",
"HKLM:\SOFTWARE\Classes\Installer\Products\",
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\"
)

$VMware_Tools_Directory = "C:\Program Files\VMware"
$VMware_Common_Directory = "C:\Program Files\Common Files\VMware"

# Create an empty array to hold all the uninstallation targets and compose the entries into the target array
$targets = @()

If ($vmware_tools_ids) {
foreach ($item in $reg_targets) {
$targets += $item + $vmware_tools_ids.reg_id
}
# Add the MSI installer ID regkey
$targets += "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{$($vmware_tools_ids.msi_id)}"
}

# This is a bit of a shotgun approach, but if we are at a version less than 2016, add the Uninstaller entries we don't
# try to automatically determine.
If ([Environment]::OSVersion.Version.Major -lt 10) {
$targets += "HKCR:\CLSID\{D86ADE52-C4D9-4B98-AA0D-9B0C7F1EBBC8}"
$targets += "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{9709436B-5A41-4946-8BE7-2AA433CAF108}"
$targets += "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{FE2F6A2C-196E-4210-9C04-2B1BC21F07EF}"
}

# Add the VMware, Inc regkey
If (Test-Path "HKLM:\SOFTWARE\VMware, Inc.") {
$targets += "HKLM:\SOFTWARE\VMware, Inc."
}

# Add the VMware Tools directory
If(Test-Path $VMware_Tools_Directory) {
$targets += $VMware_Tools_Directory
}

# Thanks to @Gadgetgeek2000 for pointing out that the script leaves some 500mb of extra artifacts on disk.
# This blob removes those.
If(Test-Path $VMware_Common_Directory) {
$targets += $VMware_Common_Directory
}

# Create a list of services to stop and remove
$services = Get-Service -DisplayName "VMware*"
$services += Get-Service -DisplayName "GISvc"

# Warn the user about what is about to happen
# Takes only y for an answer, bails otherwise.
Write-Host "The following registry keys, filesystem folders, and services will be deleted:"
If (!$targets -and !$services ) {
Write-Host "Nothing to do!"
}
Else {
$targets
$services
$user_confirmed = Read-Host "Continue (y/n)"
If ($user_confirmed -eq "y") {

# Stop all running VMware Services
$services | Stop-Service -Confirm:$false

# Cover for Remove-Service not existing in PowerShell versions < 6.0
If (Get-Command Remove-Service -errorAction SilentlyContinue) {
$services | Remove-Service -Confirm:$false
}
Else {
foreach ($s in $services) {
sc.exe DELETE $($s.Name)
}
}

# Remove all the files that are listed in $targets
foreach ($item in $targets) {
If(Test-Path $item) {
Remove-Item -Path $item -Recurse
}
}
Write-Host "Done. Reboot to complete removal."
}
Else {
Write-Host "Failed to get user confirmation"
}
}

参考

broestls/Remove_VMwareTools.ps1 - Github Gist Force removal of VMware Tools, Program Files, and Windows Services

这一排音乐感觉氛围非常的相似…

VXLLAIN, iGRES, ENXK - Crystal Skies (Sped Up)

VØJ, Narvent - Memory Reboot (4K Music Video)

Narvent - Fainted (4K Music Video)

VXLLAIN, iGRES, ENXK - Amber Skies

Xalv - Oblivion | Ana de Armas (Music Video)

Goth (Slowed + Reverb)

Navjaxx, VXLLAIN - Distant Memories (4K Official Music Video)

Lonely Lies, GOLDKID$ - Interlinked (Official Slowed Audio)

Narvent - Her Eyes (4K Music Video)

Sleepwalker (Slowed)

MONTAGEM KOE [EXTENDED]

这一堆也一样, 甚至我都没注意到是不同的歌曲, 好像能自动连在一起

我们俩DJ 2026 (戴羽彤) | Hai Chúng Ta Remix 2026 - DJFeng Remix | Hot TikTok - Douyin

Stereo Love x On The Floor Remix 2026 - DJ细粒 Remix | Hot TikTok - Douyin

一点点 (DJ抖音版) - 董唧唧、芊芊龍『My heart 请你在靠近我一点点,我又不是坏人你干嘛离我那么远。』♪ || 一听就上头的神曲 | 抖音热门歌曲 | 抖音 | TikTok ♪

落空 (抖音DJ版) - 印子月『你说完了的话还在心头汹涌,笑着挥手 还没回头 泪水比我坦诚。』♪ || 年度最佳抖音歌曲 | 抖音最火歌曲音 | 抖音 | TikTok •|• Douyin

空白DJ 2026 (Void - Pank) | Khoảng Trống Remix 2026 - DJ小智 Remix | Hot TikTok - Douyin

喜欢DJ 2026 (阿肆) | Thích Remix - A Tứ (Hot TikTok 2026) - DJZW Remix | Hot TikTok - Douyin

Sa Vào Nguy Hiểm Ver4 (Thazh x Đông Remix Tiktok 2025) 葛东琪 - 悬溺 (越南鼓卡点舞) || Hot Tiktok Douyin DJ抖音版

MƯỜI NĂM NHÂN GIAN 十年人間 - GNAB REMIX 这个旋律还不错,但是他们remix的大部分歌曲好像都是这个调

BÁI NGUYỆT 拜月 - GNAB REMIX

NHÂN GIAN KINH HỒNG KHÁCH 人间惊鸿客 - GNAB REMIX

NAN GIẢI 难解 - GNAB REMIX

往期优秀作品推荐

2026年2月-4月

查看表压缩率

1
2
3
4
5
6
7
8
9
10
11
SELECT
database,
table,
sum(rows) AS row_count,
formatReadableSize(sum(data_uncompressed_bytes)) AS uncompressed, formatReadableSize(sum(data_compressed_bytes)) AS compressed,
round(sum(data_compressed_bytes) / sum(data_uncompressed_bytes) * 100, 2) AS compression_ratio
FROM
system.parts
WHERE database != 'system' and active
GROUP BY database, table
ORDER BY compression_ratio ASC

统计字段压缩率

1
2
3
4
5
6
7
8
9
10
11
12
13
SELECT
name,
table,
formatReadableSize(sum(data_uncompressed_bytes)) AS uncompressed,
formatReadableSize(sum(data_compressed_bytes)) AS compressed,
sum(data_compressed_bytes) as compressed_bytes,
round(sum(data_compressed_bytes) / sum(data_uncompressed_bytes) * 100, 2) AS compression_ratio
FROM
system.columns
WHERE
database = '...' and table = '...'
GROUP BY table, name
ORDER BY name, compressed_bytes ASC

修改表的TTL

表本身是类似这样分区的. 注意建表的时候需要加 ttl_only_drop_parts = 1 否则 clickhouse 运行TTL清理的时候可能会执行分区内数据删除, 引起不必要的读写.

1
2
3
4
5
6
7
8
9
10
11
CREATE TABLE <table_name>
(
...
`start_time` DateTime64(3, 'Asia/Singapore') CODEC(DoubleDelta, ZSTD(3)),
...
)
ENGINE = MergeTree
PARTITION BY toStartOfHour(start_time)
ORDER BY start_time
TTL toDateTime(start_time) + toIntervalDay(90)
SETTINGS index_granularity = 8192, ttl_only_drop_parts = 1

现在需要缩短 TTL 到 80 天, 操作如下

1
2
3
4
5
6
7
8
-- 防止 Clickhouse 同步执行 TTL Materialize
set materialize_ttl_after_modify=0;

-- 修改TTL, 只修改schema不会立刻开始删除数据
alter table <table_name> modify ttl toDateTime(start_time) + toIntervalDay(80);

-- 在后台开始执行数据清理 (mutation). 不加 settings 会同步等待 TTL Materialized.
alter table <table_name> materialize ttl settings mutations_sync=0;

当然也可以直接drop掉表的某个分区, 这个操作是实时的.

1
alter table <table_name> drop partition '2026092801';

无损音乐粤语经典-林子祥《数字人生》 | 林子祥 - 數字人生『3 0624700』【動態歌詞Lyrics】

陈慧娴《千千阙歌》百万豪装录音棚大声听

VXLLAIN, iGRES, ENXK - Crystal Skies (Sped Up) | 循环歌单|《何意味の小曲》《我xxの小曲》Crystal Skies(Sped Up)

一小时单曲循环~《喽他》の【纯享版】

Chess Type Beat | joyful - chess (slowed) | 循环歌曲 |《老鼠舞の小曲》Chess Type Beat(Slowed)

Sleeping City 白菜对我笑(超燃FUNK) (TTW21 Remix Tiktok Proghouse Mix 2026) 情绪回收站 (DJ抖音版) || Hot Douyin | “白菜对我笑”の小曲是怎么创作出来的?“白菜对我笑”的不同版本! | 《白菜对我笑の小曲》《骷髅跳舞の小曲》Sleeping City Funk

《聚财咒》完整版,急急那如律令嘛咪呗呗哄!

Maduk - Alone (feat. Marianna Ray)

恋人心 (抖音DJ版) - 魏新雨「化作风化作雨化作春走向你,梦如声梦如影梦是遥望的掌印。」 ♪ || 快手热门摇BGM | 抖音熱門 | 最近热门音乐 | 抖音 | TikTok ♪

You & Me (feat. Nikolett)

《唐嘉琦の小曲》《赏金猎人の小曲》《剪辑の小曲》——MONTAGEMALQUIMIA | MONTAGEM ALQUIMIA [EXTENDED]

【循环歌单】|《幻昼4.0》“【伏黑甚尔の小曲】【天与暴君の小曲】”

《恐怖直立猿の小曲》“我发现他们好像都对石头过敏”【The King】

「我见过许多忧郁之人」【忧郁の小曲】&【生化危机の小曲】《Una Mattina (DJ纯享版)》-深夜电台

【循环歌曲】· 禅者行脚の小曲 清冷佛子の小曲《TRILLIUM HARDTEKK》 | 跳跃不是罪过 | TRILLIUM HARDTEKK - S3RL | 原版 Trillium - S3RL feat Sara

循环音乐|《海阔天空尾奏》”见过花开就好 何必在意花为谁开”

I Don’t Want to Set the World on Fire 辐射的小曲

Ramba Ho | Dhurandhar | Ranveer Singh, Shashwat Sachdev, Madhubanti Bagchi 不知道唱的什么但是很燃

MONTAGEM HIKARI [EXTENDED]

⟪Ai Đưa Em Về⟫ 中文翻译 Low Cortisol Song

往期优秀作品推荐

2025年11月

两年前写过一篇关于容器流量重定向的文章, 当时对网络了解还不是非常深刻, 加上当时podman使用的是cni插件式网络堆栈, 配置起来似乎较为复杂, Podman 4.0后已经使用netavark显得之前的配置已经有一些过时了.

Podman版本: 4.9.3

整体的目标还是一致的, 需要创建一个单独的Podman network, 挂在这个网络下的容器的出网流量默认都走到一个GRE隧道里.

先创建GRE隧道

1
2
3
4
sudo ip link add dev gre12 mtu 1380 type gre local <本地网卡地址> remote <远端网卡地址>
sudo ip addr add 10.66.4.2/30 dev gre12
sudo ip link set dev gre12 up
sudo iptables -t nat -A POSTROUTING -o gre12 -j MASQUERADE

在对端也要创建GRE隧道

1
2
3
4
5
6
7
sudo ip link add dev gre12 mtu 1380 type gre local <对端网卡地址> remote <本地网卡地址>
sudo ip addr add 10.66.4.1/30 dev gre12
sudo ip link set dev gre12 up

# 注意这里 eth0 要根据对端机器上出网网卡来决定
sudo iptables -t nat -A POSTROUTING -i gre12 -o eth0 -j MASQUERADE
sudo sysctl -w net.ipv4.ip_forward=1

然后创建容器网络

1
2
sudo podman network create --ip-range=10.89.0.0/24 overseas
sudo podman network update overseas --dns-add <目标网络DNS服务器>

配置网络转发规则

1
2
3
4
5
6
# 不是发往本地网络的, 一律添加fwmark并转发
sudo iptables -t mangle -A PREROUTING -s 10.89.0.0/24 ! -d 192.168.0.0/16 -j MARK --set-mark 0x2

# 添加标记的流量, 通过GRE隧道转发
sudo ip rule add fwmark 2 lookup 55
sudo ip route add default via 10.66.4.1 table 55