AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / computer / 问题

问题[wireguard](computer)

Martin Hope
amin2783
Asked: 2024-08-13 14:33:34 +0800 CST

Wireguard 如何改变 TTL 值?

  • 5

我的 ISP 设置传入数据包的 TTL,使得它在我的设备上(路由器之后)始终为 TTL=1。
TTL 始终为 1,无需 wireguard

他们这样做是为了让最终用户无法添加另一个路由器并重新共享连接。但这也导致我无法在 WSL2 中使用互联网。WSL2 创建了一个虚拟 LAN 接口来访问互联网。

经过一番探索,我发现当我使用 wireguard 时,WSL2 可以获得互联网,我可以从我的电脑重新共享互联网,而且 TTL 值更高。

使用 wireguard 提高 TTL

现在我的问题是这怎么可能呢?

我的路由器不知道所述数据包已发送到 wireguard 服务器。因此,从 wireguard 服务器返回的数据包在我的路由器上将具有 TTL=2,就像任何其他数据包一样。然后我的 PC 将获得 TTL=1 的数据包,就像任何其他数据包一样。但是该数据包的 TTL 为何高于 1?数据包可以“包装”吗?例如,传入数据包的 TTL=1,到达我的 wireguard 接口,但在被 wireguard 接口解包后,它会获得一个新的 TTL。有关此“包装”的任何资源也将有所帮助。

wireguard
  • 1 个回答
  • 18 Views
Martin Hope
akc42
Asked: 2023-10-22 02:12:58 +0800 CST

无法获取 Wireguard 客户端配置以与 tplink 605 vpn l2tp 服务器一起使用

  • 6

我家里有一个 tplink 605 路由器/VPN 服务器。我已经为传入流量设置了预共享密钥 l2tp 服务器。我已经使用 iPhone 的 VPN 功能进行了此操作。

我现在正在尝试设置一个带有wireguard的树莓派作为客户端。尽管每次启动时都会出现错误。

我试图找到适合这种情况的任何文档,但找不到任何文档。大多数(如果不是全部)情况都描述了使用加密密钥。

我的wg0.conf文件看起来像这样

[Interface]
Address = 192.168.140.0/24 
DNS = 192.168.17.200

[Peer]

PresharedKey = <client psk>
AllowedIPs = 192.168.17.0/24
Endpoint = home.example.com:192.168.17.1
PersistentKeepalive = 25

我的家庭网络位于 192.168.17.0/24,tplink 路由器位于 192.168.17.1,dns/dhcp 服务器位于 192.168.17.200,它有一个 IP 地址的“VPN 池”,位于 192.168.140.0/24

当它启动时,告诉我 的值<client psk>太长(它是 10 个字符),但也让我担心的是我没有输入任何地方,也没有找到任何说明哪里的指令

wg0.conf 有一些“非官方”参考,但我查看的参考根本没有提到预共享密钥。

这个文件应该是什么样子

wireguard
  • 1 个回答
  • 39 Views
Martin Hope
Paul
Asked: 2022-09-04 02:29:07 +0800 CST

限制 Wireguard 客户端仅访问少数服务器

  • 6

我有一个wireguard 服务器,可以控制对AWS 中服务器网络的访问。通过wireguard 连接的客户端的地址为10.11.0.{2-5}。我有 4 个客户端以完全访问权限访问 LAN - LAN 位于 10.1.255.255 上。这很好用。

现在我想添加一个只能访问少量服务器的客户端。

所以我在 wg0.conf 中添加了一些 PostUp 命令,并使用 iptables 将这个客户端限制在这些服务器上。

[注意我更喜欢使用 PostUp 命令而不是单独的 postup.sh 文件,因为它将自定义内容保存在一个地方。]

以下是 iptables 命令。客户端 10.11.0.{2,3,4,5} 应该能够访问所有内容。客户端 10.11.0.6 应该只能访问三个特定的 IP 地址。正在发生的事情是客户端 .6 仍然可以访问所有内容。

PostUp = iptables -t nat -I POSTROUTING -o eth0  -j MASQUERADE -s 10.11.0.0/16

# Add a WIREGUARD_wg0 chain
PostUp = iptables -N WIREGUARD_wg0
PostUp = iptables -A FORWARD -j WIREGUARD_wg0

# Accept traffic from valid Wireguard client IP addresses
PostUp = iptables -A WIREGUARD_wg0 -s 10.11.0.2,10.11.0.3,10.11.0.4,10.11.0.5 -i %i -j ACCEPT
# This client can only access these servers.
PostUp = iptables -A WIREGUARD_wg0 -s 10.11.0.6 -i %i -d    10.1.1.101,10.1.1.151,10.1.0.101 -j ACCEPT
PostUp = iptables -A WIREGUARD_wg0 -s 10.11.0.6 -i %i -j DROP

# Drop everything else coming through the Wireguard interface
PostUp = iptables -A WIREGUARD_wg0 -i %i -j DROP

# Return to FORWARD chain
PostUp = iptables -A WIREGUARD_wg0 -j RETURN

PostDown = iptables -t nat -D POSTROUTING -o eth0  -j MASQUERADE -s 10.11.0.0/16

# Flush and delete the WIREGUARD_wg0 chain
PostDown = iptables -D FORWARD -j WIREGUARD_wg0
PostDown = iptables -F WIREGUARD_wg0
PostDown = iptables -X WIREGUARD_wg0

这是之后的状态wg-quick down wg0:

/etc/wireguard# iptables-save -c
# Generated by iptables-save v1.8.4 on Sat Sep  3 21:06:20 2022
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
[42:2688] -A POSTROUTING -s 10.11.0.0/16 -o eth0 -j MASQUERADE
[122:7896] -A POSTROUTING -s 10.1.0.0/16 -j MASQUERADE
COMMIT
# Completed on Sat Sep  3 21:06:20 2022
# Generated by iptables-save v1.8.4 on Sat Sep  3 21:06:20 2022
*filter
:INPUT ACCEPT [33:3296]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [29:4668]
[4503:562848] -A FORWARD -i wg0 -j ACCEPT
COMMIT
# Completed on Sat Sep  3 21:06:20 2022

然后之后wg-quick up wg0:

/etc/wireguard# iptables-save -c
# Generated by iptables-save v1.8.4 on Sat Sep  3 21:07:01 2022
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
[0:0] -A POSTROUTING -s 10.11.0.0/16 -o eth0 -j MASQUERADE
[42:2688] -A POSTROUTING -s 10.11.0.0/16 -o eth0 -j MASQUERADE
[122:7896] -A POSTROUTING -s 10.1.0.0/16 -j MASQUERADE
COMMIT
# Completed on Sat Sep  3 21:07:01 2022
# Generated by iptables-save v1.8.4 on Sat Sep  3 21:07:01 2022
*filter
:INPUT ACCEPT [15:1036]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [14:2920]
:WIREGUARD_wg0 - [0:0]
[4503:562848] -A FORWARD -i wg0 -j ACCEPT
[0:0] -A FORWARD -j WIREGUARD_wg0
[0:0] -A WIREGUARD_wg0 -s 10.11.0.2/32 -i wg0 -j ACCEPT
[0:0] -A WIREGUARD_wg0 -s 10.11.0.3/32 -i wg0 -j ACCEPT
[0:0] -A WIREGUARD_wg0 -s 10.11.0.4/32 -i wg0 -j ACCEPT
[0:0] -A WIREGUARD_wg0 -s 10.11.0.5/32 -i wg0 -j ACCEPT
[0:0] -A WIREGUARD_wg0 -s 10.11.0.6/32 -d 10.1.1.101/32 -i wg0 -j ACCEPT
[0:0] -A WIREGUARD_wg0 -s 10.11.0.6/32 -d 10.1.1.151/32 -i wg0 -j ACCEPT
[0:0] -A WIREGUARD_wg0 -s 10.11.0.6/32 -d 10.1.0.101/32 -i wg0 -j ACCEPT
[0:0] -A WIREGUARD_wg0 -s 10.11.0.6/32 -i wg0 -j DROP
[0:0] -A WIREGUARD_wg0 -i wg0 -j DROP
[0:0] -A WIREGUARD_wg0 -j RETURN
COMMIT
# Completed on Sat Sep  3 21:07:01 2022

谁能建议我错过了什么?非常感谢。保罗。

iptables wireguard
  • 1 个回答
  • 161 Views
Martin Hope
brec
Asked: 2022-06-15 15:42:54 +0800 CST

WireGuard peer 向服务器发送初始化消息;服务器收不到

  • 5

目录:上下文;同行 wg0.conf 摘录;服务器 wg0.conf 摘录;tshark 数据包嗅探器输出。

上下文:Peer 是一个无头 LAN 主机,我通过 SSH 从同一 LAN 上的 Mac 配置/控制;服务器位于云中的 VPS 上,因此也可以通过 SSH 进行配置/控制。对等体的目的是将来自另一台 LAN 主机(目前只有一个)的输入转发到隧道并从隧道返回结果。服务器旨在获取隧道输出,对其进行 NAT,将其发送到其 WAN 目的地,并通过隧道返回回复。

对等 wg0.conf 内容,为简洁而编辑:

[Interface]
PrivateKey = ...
Address = 10.4.0.2/24

Table = 248     # wg-quick to use PBR for its default route based on:
PostUp = ip rule add not to 192.168.1.0/24 table 248   # not to local subnet
PostUp = ufw route allow in on enp1s0 out on %i
PostUp = ufw route allow in on %i out on enp1s0

PreDown = (*PreDowns omitted for brevity*)

[Peer]
PublicKey = ...
PersistentKeepalive = 25
AllowedIPs = 0.0.0.0/0
Endpoint = [IP of VPS]:51820

注意:表 48 规则是将 SSH 流量保持在隧道之外。

服务器 wg0.conf 内容,为简洁而编辑:

[Interface]
PrivateKey = ...
Address = 10.4.0.1/24
ListenPort = 51820

PostUp = ufw route allow in on wg0 out on enp1s0
Table = 248     # wg-quick to use PBR for its default route, i.e.:
# default dev wg0 table 248 scope link
PostUp = ip rule add to 10.4.0.0/24 table 248
PostUp = iptables -t nat -I POSTROUTING -o enp1s0 -j MASQUERADE

(PreDowns omitted for brevity)

[Peer]
PublicKey = ...
AllowedIPs = 0.0.0.0/0

至于对等体,这里的 PBR 是为了将 SSH 流量排除在隧道之外。我不确定这是这样做的方法。

就在对等点启动后,服务器对sudo wg显示的响应transfer: 148 B received, 92 B sent保持不变。对等体显示transfer: 92 B received, 11.43 KiB sent,“发送”数量随时间增加。tshark 为对等接口 wg0 显示了这一点:

1 0.000000000     10.4.0.2 → [IP of VPS] WireGuard 176 Handshake Initiation, sender=0xBC9317D6
2 5.376117117     10.4.0.2 → [IP of VPS] WireGuard 176 Handshake Initiation, sender=0x6B160407

每隔 5.4 秒添加一行,在时间戳之后直到发件人 ID 相同。在服务器上,tshark 显示 wg0 根本没有流量。

我对 WireGuard 和 tshark 没有经验。在输出过程中,我可以在没有 SSH 挂在一个或另一个上的情况下让双方都站起来,这是一个艰难的过程wg-quick up。我省略了您需要的上下文,或者犯了令人头疼的错误,这根本不会让我感到惊讶。感谢您帮助服务​​器听到并与对等方握手。

networking wireguard
  • 1 个回答
  • 46 Views
Martin Hope
Nik
Asked: 2022-03-23 02:15:58 +0800 CST

如何只允许对等方访问 Internet?

  • 5

我尝试了很长时间以找到“如何允许对等方仅访问Internet?”问题的答案,但我没有找到任何东西。我唯一理解的是,这可以通过 iptables 来完成。

仅 Internet 访问意味着其他对等方无法访问其他对等方

目前,这是我的wireguard配置-

[Interface]
Address = 10.0.0.1/24
SaveConfig = true
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
ListenPort = 51830
PrivateKey = <private_key>
iptables wireguard
  • 2 个回答
  • 150 Views
Martin Hope
StarDust
Asked: 2021-12-11 17:48:16 +0800 CST

您是否需要在 Wireguard 中为每个对等方放置一个端点?

  • 5

假设网络中有 3 个对等点。A 和 B 知道对方的 IP 地址,但 C 只知道 A 的 IP 地址。因此,在 A 的配置中,它为 B 指定了一个端点,而不是 C。在 B 的配置中,它为 A 而不是 C 指定了端点。在 C 的配置中,它为 A 指定了一个端点,但没有B. 如果 B 和 C 都知道 A,他们还能相互连接吗?

networking wireguard
  • 1 个回答
  • 474 Views
Martin Hope
StarDust
Asked: 2021-12-11 08:07:26 +0800 CST

从同一对等方访问对等方的 Wireguard IP 地址

  • 5

我设置了 Wireguard。我可以连接到10.200.200.1Peer 1 上的地址,Peer 2。但是,我无法连接到10.200.200.1Peer 1。我该怎么做?

对等体 1 的配置:

[Interface]
Address = 10.200.200.1/24
ListenPort = 51820
PrivateKey = ************

# substitute eth0 in the following lines to match the Internet-facing interface
# if the server is behind a router and receives traffic via NAT, these iptables rules are not needed
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o enp0s2 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o enp0s2 -j MASQUERADE

[Peer]
# foo
PublicKey = ***************
#PresharedKey = PRE-SHARED_KEY
AllowedIPs = 10.200.200.2/8

#PersistentKeepalive = 25

curl 10.200.200.1:2001给我

*   Trying 10.200.200.1:2001...
* connect to 10.200.200.1 port 2001 failed: Connection refused
* Failed to connect to 10.200.200.1 port 2001 after 0 ms: Connection refused
* Closing connection 0
curl: (7) Failed to connect to 10.200.200.1 port 2001 after 0 ms: Connection refused

不过我可以ping10.200.200.1通。

wireguard
  • 1 个回答
  • 265 Views
Martin Hope
hata
Asked: 2021-09-28 18:47:04 +0800 CST

macOS 11.6 更新后,WireGuard 的窗口每次启动时都会打开

  • 5

我注意到 WireGuard 的窗口在 macOS 11.6 更新后每次启动时都会打开。

截屏

这对我来说每次都关闭窗口很烦人。

我该如何解决?

macos wireguard
  • 1 个回答
  • 24 Views
Martin Hope
Thomas
Asked: 2021-08-19 08:08:53 +0800 CST

具有wireguard的多个对等点的相同AllowedIP

  • 7

当我将网络范围添加为AllowedIPs例如wg set wgvpn peer abcd… allowed-ips ::/0时,该网络将从所有其他对等方中删除。

如何将相同的 AllowedIP 添加到多个对等点?

我想这样做的原因是创建一个完整的网格,并围绕向下的对等点进行路由。

我需要为此设置单独的wireguard接口吗?

wireguard
  • 1 个回答
  • 2437 Views
Martin Hope
pgcudahy
Asked: 2020-04-01 12:07:45 +0800 CST

Wireguard 隧道缓慢且断断续续

  • 9

问完这个问题后,我得到了一个wireguard vpn 设置,它将所有流量从我的本地局域网转发到远程服务器。从wireguard 客户端主机连接很快。但是,来自局域网上的客户端的连接要慢得多,并且会断开很多连接。Traceroutes 显示客户端和 LAN 客户端都通过 VPN 连接并正确退出

在wireguard客户端主机上,我得到一个糟糕的ping,但速度不错

curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python -
Retrieving speedtest.net configuration...
Testing from Spectrum (68.187.109.97)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by Bertram Communications (Iron Ridge, WI) [185.33 km]: 598.9 ms
Testing download speed................................................................................
Download: 4.65 Mbit/s
Testing upload speed................................................................................................
Upload: 4.97 Mbit/s

但是这段代码只是挂在局域网客户端上,它甚至无法下载运行所需的脚本。一些简单的网站将加载,但任何实质性的超时。

我该如何开始调试呢?我的第一个问题是我的 iptables 规则可能配置错误


# ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:84:56:f5 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.104/24 brd 192.168.1.255 scope global noprefixroute eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::ba27:ebff:fe84:56f5/64 scope link 
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether b8:27:eb:d1:03:a0 brd ff:ff:ff:ff:ff:ff
4: eth0.2@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether b8:27:eb:84:56:f5 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.1/24 brd 10.0.0.255 scope global noprefixroute eth0.2
       valid_lft forever preferred_lft forever
    inet6 fe80::ba27:ebff:fe84:56f5/64 scope link 
       valid_lft forever preferred_lft forever
5: wg0: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1120 qdisc noqueue state UNKNOWN group default qlen 1000
    link/none 
    inet 192.168.99.17/24 scope global wg0
       valid_lft forever preferred_lft forever

# ip -4 route show table all
default dev wg0 table 51820 scope link 
default via 192.168.1.1 dev eth0 src 192.168.1.104 metric 202 mtu 1200 
10.0.0.0/24 dev eth0.2 proto dhcp scope link src 10.0.0.1 metric 204 mtu 1200 
192.168.1.0/24 dev eth0 proto dhcp scope link src 192.168.1.104 metric 202 mtu 1200 
192.168.99.0/24 dev wg0 proto kernel scope link src 192.168.99.17 
broadcast 10.0.0.0 dev eth0.2 table local proto kernel scope link src 10.0.0.1 
local 10.0.0.1 dev eth0.2 table local proto kernel scope host src 10.0.0.1 
broadcast 10.0.0.255 dev eth0.2 table local proto kernel scope link src 10.0.0.1 
broadcast 127.0.0.0 dev lo table local proto kernel scope link src 127.0.0.1 
local 127.0.0.0/8 dev lo table local proto kernel scope host src 127.0.0.1 
local 127.0.0.1 dev lo table local proto kernel scope host src 127.0.0.1 
broadcast 127.255.255.255 dev lo table local proto kernel scope link src 127.0.0.1 
broadcast 192.168.1.0 dev eth0 table local proto kernel scope link src 192.168.1.104 
local 192.168.1.104 dev eth0 table local proto kernel scope host src 192.168.1.104 
broadcast 192.168.1.255 dev eth0 table local proto kernel scope link src 192.168.1.104 
broadcast 192.168.99.0 dev wg0 table local proto kernel scope link src 192.168.99.17 
local 192.168.99.17 dev wg0 table local proto kernel scope host src 192.168.99.17 
broadcast 192.168.99.255 dev wg0 table local proto kernel scope link src 192.168.99.17 

# ip -4 rule show
0:  from all lookup local 
32764:  from all lookup main suppress_prefixlength 0 
32765:  not from all fwmark 0xca6c lookup 51820 
32766:  from all lookup main 
32767:  from all lookup default 

# ip -6 route show table all
::1 dev lo proto kernel metric 256 pref medium
fe80::/64 dev eth0 proto kernel metric 256 pref medium
fe80::/64 dev eth0.2 proto kernel metric 256 pref medium
local ::1 dev lo table local proto kernel metric 0 pref medium
local fe80::ba27:ebff:fe84:56f5 dev eth0.2 table local proto kernel metric 0 pref medium
local fe80::ba27:ebff:fe84:56f5 dev eth0 table local proto kernel metric 0 pref medium
ff00::/8 dev eth0 table local metric 256 pref medium
ff00::/8 dev eth0.2 table local metric 256 pref medium

# ip -6 rule show
0:  from all lookup local 
32766:  from all lookup main 

# wg
interface: wg0
  public key: XR9UASLZXCjRZKa9MnmBxebfP6jxfBaaQOa5BJEFsX8=
  private key: (hidden)
  listening port: 48767
  fwmark: 0xca6c

peer: M37O/lE0ZWZ0uzYVGu17ZAZmdbnLyd5RuiAVvF/bqwE=
  endpoint: 68.187.109.97:51820
  allowed ips: 0.0.0.0/0
  latest handshake: 2 minutes, 20 seconds ago
  transfer: 2.42 MiB received, 8.45 MiB sent

# ip netconf
inet lo forwarding on rp_filter off mc_forwarding off proxy_neigh off ignore_routes_with_linkdown off 
inet eth0 forwarding on rp_filter off mc_forwarding off proxy_neigh off ignore_routes_with_linkdown off 
inet wlan0 forwarding on rp_filter off mc_forwarding off proxy_neigh off ignore_routes_with_linkdown off 
inet eth0.2 forwarding on rp_filter off mc_forwarding off proxy_neigh off ignore_routes_with_linkdown off 
inet wg0 forwarding on rp_filter off mc_forwarding off proxy_neigh off ignore_routes_with_linkdown off 
inet all forwarding on rp_filter off mc_forwarding off proxy_neigh off ignore_routes_with_linkdown off 
inet default forwarding on rp_filter off mc_forwarding off proxy_neigh off ignore_routes_with_linkdown off 
inet6 lo forwarding off mc_forwarding off proxy_neigh off ignore_routes_with_linkdown off 
inet6 eth0 forwarding off mc_forwarding off proxy_neigh off ignore_routes_with_linkdown off 
inet6 wlan0 forwarding off mc_forwarding off proxy_neigh off ignore_routes_with_linkdown off 
inet6 eth0.2 forwarding off mc_forwarding off proxy_neigh off ignore_routes_with_linkdown off 
inet6 all forwarding off mc_forwarding off proxy_neigh off ignore_routes_with_linkdown off 
inet6 default forwarding off mc_forwarding off proxy_neigh off ignore_routes_with_linkdown off 

# iptables-save
# Generated by xtables-save v1.8.2 on Thu Apr  2 19:11:02 2020
*raw
:PREROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A PREROUTING -d 192.168.99.17/32 ! -i wg0 -m addrtype ! --src-type LOCAL -m comment --comment "wg-quick(8) rule for wg0" -j DROP
COMMIT
# Completed on Thu Apr  2 19:11:02 2020
# Generated by xtables-save v1.8.2 on Thu Apr  2 19:11:02 2020
*mangle
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A PREROUTING -p udp -m comment --comment "wg-quick(8) rule for wg0" -j CONNMARK --restore-mark --nfmask 0xffffffff --ctmask 0xffffffff
-A POSTROUTING -p udp -m mark --mark 0xca6c -m comment --comment "wg-quick(8) rule for wg0" -j CONNMARK --save-mark --nfmask 0xffffffff --ctmask 0xffffffff
COMMIT
# Completed on Thu Apr  2 19:11:02 2020
# Generated by xtables-save v1.8.2 on Thu Apr  2 19:11:02 2020
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A FORWARD -i wg0 -o eth0.2 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i eth0.2 -o wg0 -j ACCEPT
COMMIT
# Completed on Thu Apr  2 19:11:02 2020
# Generated by xtables-save v1.8.2 on Thu Apr  2 19:11:02 2020
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A POSTROUTING -o wg0 -j MASQUERADE
COMMIT
# Completed on Thu Apr  2 19:11:02 2020
vpn wireguard
  • 2 个回答
  • 22016 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何减少“vmmem”进程的消耗?

    • 11 个回答
  • Marko Smith

    从 Microsoft Stream 下载视频

    • 4 个回答
  • Marko Smith

    Google Chrome DevTools 无法解析 SourceMap:chrome-extension

    • 6 个回答
  • Marko Smith

    Windows 照片查看器因为内存不足而无法运行?

    • 5 个回答
  • Marko Smith

    支持结束后如何激活 WindowsXP?

    • 6 个回答
  • Marko Smith

    远程桌面间歇性冻结

    • 7 个回答
  • Marko Smith

    子网掩码 /32 是什么意思?

    • 6 个回答
  • Marko Smith

    鼠标指针在 Windows 中按下的箭头键上移动?

    • 1 个回答
  • Marko Smith

    VirtualBox 无法以 VERR_NEM_VM_CREATE_FAILED 启动

    • 8 个回答
  • Marko Smith

    应用程序不会出现在 MacBook 的摄像头和麦克风隐私设置中

    • 5 个回答
  • Martin Hope
    Vickel Firefox 不再允许粘贴到 WhatsApp 网页中? 2023-08-18 05:04:35 +0800 CST
  • Martin Hope
    Saaru Lindestøkke 为什么使用 Python 的 tar 库时 tar.xz 文件比 macOS tar 小 15 倍? 2021-03-14 09:37:48 +0800 CST
  • Martin Hope
    CiaranWelsh 如何减少“vmmem”进程的消耗? 2020-06-10 02:06:58 +0800 CST
  • Martin Hope
    Jim Windows 10 搜索未加载,显示空白窗口 2020-02-06 03:28:26 +0800 CST
  • Martin Hope
    andre_ss6 远程桌面间歇性冻结 2019-09-11 12:56:40 +0800 CST
  • Martin Hope
    Riley Carney 为什么在 URL 后面加一个点会删除登录信息? 2019-08-06 10:59:24 +0800 CST
  • Martin Hope
    zdimension 鼠标指针在 Windows 中按下的箭头键上移动? 2019-08-04 06:39:57 +0800 CST
  • Martin Hope
    jonsca 我所有的 Firefox 附加组件突然被禁用了,我该如何重新启用它们? 2019-05-04 17:58:52 +0800 CST
  • Martin Hope
    MCK 是否可以使用文本创建二维码? 2019-04-02 06:32:14 +0800 CST
  • Martin Hope
    SoniEx2 更改 git init 默认分支名称 2019-04-01 06:16:56 +0800 CST

热门标签

windows-10 linux windows microsoft-excel networking ubuntu worksheet-function bash command-line hard-drive

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve