echo "100 vpn" >> /etc/iproute2/rt_tables
echo 1 > /proc/sys/net/ipv4/ip_forward
export VPN_NET="10.10.10.0/24"
export VPN_IFACE="tun1"
export VPN_OFACE="tun2s1"
iptables -t nat -A PREROUTING -s $VPN_NET -i $VPN_IFACE -m conntrack --ctstate RELATED,ESTABLISHED -j CONNMARK --restore-mark --nfmask 0xffffffff --ctmask 0xffffffff
iptables -t nat -A PREROUTING -s $VPN_NET -j MARK --set-xmark 0x1/0xffffffff
iptables -t nat -A PREROUTING -s $VPN_NET -j CONNMARK --save-mark --nfmask 0xffffffff --ctmask 0xffffffff
iptables -t nat -A POSTROUTING -s $VPN_NET -o $VPN_OFACE -j MASQUERADE
ip rule add fwmark 1 table vpn
ip route add default dev $VPN_OFACE table vpn
ip route flush cache
[local_calls-p1]
exten => _[1-9],1,NoOp(Call on local subscriber)
same => n,Dial(PJSIP/10${EXTEN},30)
same => n,Playback(kv-number&vm-isunavail)
same => n,Hangup()
exten => _[1-5][0,1-7],1,NoOp(Call on local subscriber)
same => n,Dial(PJSIP/1${EXTEN},30)
same => n,Playback(kv-number&vm-isunavail)
same => n,Hangup()
sudo nft add rule nat PREROUTING iifname "eth0" tcp dport {224} dnat 10.0.0.2
(wg0) на ip 10.0.0.2?
sudo nft add rule nat postrouting oifname wg0 masquerade
LocalIdentifier
string
The name of the group. If Hybrid Authentication is used, the string must end with "hybrid".
content: "{{ config.stdout | replace('\\n', '\n') }}"