Skip to content

Commit

Permalink
gateway+tinc: misc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
iBug committed Nov 5, 2023
1 parent 7f37e9b commit 7a02ddd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
23 changes: 12 additions & 11 deletions docs/infrastructure/intranet/gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ For server configuration on each gateway, refer to their corresponding documenta

- [Gateway EL](../../services/gateway-el.md)
- [Gateway NIC](../../services/gateway-nic.md)
- Gateway JP (missing)
- [Gateway JP](../../services/gateway-jp.md)

## Tinc "received packet on ustclug with own address as source address" workaround {#tinc-workaround-1}

After migrating to PVE, we found that sometimes tinc works abnormally within gateway-el and gateway-nic, with following kernel log:

```
```text
bridge: received packet on ustclug with own address as source address (addr:12:34:56:78:90:ab, vlan:0)
bridge: received packet on ustclug with own address as source address (addr:12:34:56:78:90:ab, vlan:0)
bridge: received packet on ustclug with own address as source address (addr:12:34:56:78:90:ab, vlan:0)
Expand All @@ -35,28 +35,29 @@ net_ratelimit: 2 callbacks suppressed

We still don't know the source of this issue. To workaround that, following self-check timer is deployed now:

```console
$ cat /opt/tinc-check.sh
```shell title="/opt/tinc-check.sh"
#!/bin/bash

restart() {
systemctl stop [email protected]
sleep 3 # avoid race condition
systemctl start [email protected]
echo "tinc restarted"
systemctl stop [email protected]
sleep 3 # avoid race condition
systemctl start [email protected]
echo "tinc restarted"
}

dmesg | tail -n 2 | grep 'received packet on ustclug with own address as source address' && restart || echo "tinc OK now";
$ cat /etc/systemd/system/tinc-check.service
```

```ini title="/etc/systemd/system/tinc-check.service"
[Unit]
Description=Tinc Check and Auto-Restart


[Service]
Type=oneshot
ExecStart=/opt/tinc-check.sh
```

$ cat /etc/systemd/system/tinc-check.timer
```ini title="/etc/systemd/system/tinc-check.timer"
[Unit]
Description=Tinc Check and Auto-Restart Timer

Expand Down
2 changes: 1 addition & 1 deletion docs/infrastructure/tinc.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Match LocalAddress 10.254.0.0
Match LocalAddress 202.38.95.110,202.141.160.110,202.141.176.110,218.104.71.170
AllowUsers root
PubkeyAuthentication yes
AuthorizedKeysFile /dev/null # 屏蔽公钥,仅允许证书登录
AuthorizedKeysFile none # 屏蔽公钥,仅允许证书登录

# For SSH Push trigger
Match User mirror
Expand Down

0 comments on commit 7a02ddd

Please sign in to comment.