Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions softether-brige/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sudo systemctl daemon-reload
systemctl enable --now custom-routing.service
11 changes: 11 additions & 0 deletions softether-brige/custom-routing.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=Custom Routing
After=vpnserver.service

[Service]
Type=oneshot
ExecStartPre=/bin/sleep 10
ExecStart=/usr/local/bin/custom-routing.sh

[Install]
WantedBy=multi-user.target
17 changes: 17 additions & 0 deletions softether-brige/custom-routing.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
# /usr/local/bin/custom-routing.sh
set -Ceu

# tap_tap1にDHCPでアドレスを振る
dhclient tap_tap1

# すでに設定されているデフォルトルートを削除
sudo ip route del default dev eth0
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sudo いらないかも?(要検証)

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

そんなことはなくない?

sudo ip route del default dev tap_tap1

# NICとネットワークごとにrouteを設定
sudo ip route add 10.0.0.0/10 via 10.20.9.254 dev eth0
sudo ip route add 192.168.1.0/24 dev enx18ece79662c7

# デフォルトルートを設定
sudo ip route add default via 10.200.0.1 dev tap_tap1