Difference between revisions of "Wg-quick up"
Jump to navigation
Jump to search
Line 6: | Line 6: | ||
[[ip link]] set [[mtu]] 1420 up dev wg- | [[ip link]] set [[mtu]] 1420 up dev wg- | ||
[[resolvconf]] -a tun.wg0 -m 0 -x | [[resolvconf]] -a tun.wg0 -m 0 -x | ||
− | [[wg set]] wg0 fwmark | + | [[wg set]] wg0 fwmark 5555 |
+ | ip -4 route add 0.0.0.0/0 dev wg0 table 5555 | ||
+ | ip -4 rule add not fwmark 5555 table 5555 | ||
+ | ip -4 rule add table main suppress_prefixlength 0 | ||
+ | [[sysctl]] -q net.ipv4.conf.all.src_valid_mark=1 | ||
+ | [[iptables-restore]] -n | ||
== See also == | == See also == | ||
* {{wg}} | * {{wg}} |
Revision as of 10:29, 9 December 2020
wg-quick up interfacename
ip link add wg0 type wireguard wg setconf wg /dev/fd/63 ip -4 address add xx.xx.xx.xx/32 dev wg0 ip link set mtu 1420 up dev wg- resolvconf -a tun.wg0 -m 0 -x wg set wg0 fwmark 5555 ip -4 route add 0.0.0.0/0 dev wg0 table 5555 ip -4 rule add not fwmark 5555 table 5555 ip -4 rule add table main suppress_prefixlength 0 sysctl -q net.ipv4.conf.all.src_valid_mark=1 iptables-restore -n
See also
Advertising: