mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2026-04-19 15:49:08 +02:00
Add several NixOS hosts on Proxmox and Oracle Cloud
This commit is contained in:
parent
9afb9ec47e
commit
acc0ad68e0
43 changed files with 4356 additions and 187 deletions
14
scripts/server1/routing.sh
Normal file
14
scripts/server1/routing.sh
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#! /usr/bin/env bash
|
||||
VPNIF="tun0"
|
||||
VPNUSER="vpn"
|
||||
GATEWAYIP=$(ifconfig $VPNIF | egrep -o '([0-9]{1,3}\.){3}[0-9]{1,3}' | egrep -v '255|(127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})' | tail -n1)
|
||||
if [[ `ip rule list | grep -c 0x1` == 0 ]]; then
|
||||
ip rule add from all fwmark 0x1 lookup $VPNUSER
|
||||
fi
|
||||
ip route replace default via $GATEWAYIP table $VPNUSER
|
||||
ip route append default via 127.0.0.1 dev lo table $VPNUSER
|
||||
ip route flush cache
|
||||
|
||||
bash /etc/openvpn/update-resolv-conf
|
||||
|
||||
exit 0
|
||||
Loading…
Add table
Add a link
Reference in a new issue