Last active
October 11, 2016 21:16
-
-
Save zsteva/dc2c8f1e393be6af939046c183d731e9 to your computer and use it in GitHub Desktop.
ssh vpn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # /etc/ssh/sshd_config | |
| # ..... | |
| Match User zsteva | |
| PermitTunnel yes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # /etc/systemd/network/vpn.netdev | |
| [NetDev] | |
| Name=tun5 | |
| Kind=tun | |
| MTUBytes=1480 | |
| [TUN] | |
| User=zsteva | |
| Group=network | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # /etc/systemd/network/vpn.network | |
| [Match] | |
| Name=tun5 | |
| [Address] | |
| Address=192.168.57.1/32 | |
| Peer=192.168.57.100/32 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # host1# systemctl restart systemd-networkd | |
| # host1# systemctl restart sshd | |
| # host2# systemctl restart systemd-networkd | |
| ssh -n -w5:5 host1 \ | |
| -o ServerAliveInterval=30 \ | |
| -o ServerAliveCountMax=5 \ | |
| -o TCPKeepAlive=yes \ | |
| -N |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # /etc/systemd/network/vpn.netdev | |
| [NetDev] | |
| Name=tun5 | |
| Kind=tun | |
| MTUBytes=1480 | |
| [TUN] | |
| User=zsteva | |
| Group=network |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # /etc/systemd/network/vpn.network | |
| [Match] | |
| Name=tun5 | |
| [Address] | |
| Address=192.168.57.100/32 | |
| Peer=192.168.57.1/32 | |
| [Route] | |
| Destination=192.168.56.0/24 | |
| Gateway=192.168.57.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment