Skip to content

Instantly share code, notes, and snippets.

@me7media
Last active April 24, 2018 19:43
Show Gist options
  • Save me7media/bcfea97d9e72dc10ff0bdc451a527b42 to your computer and use it in GitHub Desktop.
Save me7media/bcfea97d9e72dc10ff0bdc451a527b42 to your computer and use it in GitHub Desktop.
VPN and internet и интернет одновременно на ubuntu termilal VPS (1C Предприятие)
sudo apt-get install pptp-linux pptpd ppp curl
sudo nano /etc/ppp/peers/tgvpn
pty "pptp ***.***.***.*** --nolaunchpppd"
lock
noauth
nobsdcomp
nodeflate
name USERNAME
remotename tgvpn
ipparam tgvpn
require-mppe-128
usepeerdns
defaultroute
persist
sudo nano /etc/ppp/peers/work
maxfail 0
lcp-echo-interval 60
lcp-echo-failure 4
pty "pptp ***.***.***.*** --nolaunchpppd"
name USERNAME
remotename PPTP
require-mppe-128
file /etc/ppp/options.pptp
ipparam work
nano /etc/ppp/chap-secrets
#username[tab]tgvpn[tab]password[tab]*
# client server secret IP addresses
USERNAME tgvpn PASSWORD *
USERNAME PPTP PASSWORD *
sudo nano /etc/ppp/ip-up.local
#!/bin/bash
sudo route add -net *.*.*.0 netmask 255.255.254.0 dev ppp0;
sudo chmod a+x /etc/ppp/ip-up.local
sudo pon tgvpn
sudo poff work
sudo pppd call work
sudo route add -net *.*.*.0 netmask 255.255.254.0 dev ppp0;
ping -c 1 *.*.*.*
ping -c 1 google.com
route -n
curl http://*.*.*.*:80/test/hs/
ubuntu@ubuntu:~$ route -nKernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 100 0 0 enp3s0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 enp3s0
192.168.1.0 0.0.0.0 255.255.255.0 U 100 0 0 enp3s0
***.***.***.*** 192.168.1.1 255.255.255.255 UGH 0 0 0 enp3s0
ping -c 1 google.com (IS OK)
ubuntu@ubuntu:~$ sudo pon tgvpnubuntu@ubuntu:~$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 100 0 0 enp3s0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 enp3s0
192.168.1.0 0.0.0.0 255.255.255.0 U 100 0 0 enp3s0
*.*.*.7 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0 <<<<LOOKING THIS
***.***.***.*** 192.168.1.1 255.255.255.255 UGH 0 0 0 enp3s0
ping -c 1 google.com (IS OK)
ping -c 1 *.*.*.* (NOT)
ubuntu@ubuntu:~$ sudo route add -net *.*.*.0 netmask 255.255.254.0 dev ppp0;
ubuntu@ubuntu:~$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 100 0 0 enp3s0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 enp3s0
192.168.1.0 0.0.0.0 255.255.255.0 U 100 0 0 enp3s0
*.*.*.0 0.0.0.0 255.255.254.0 U 0 0 0 ppp0
*.*.*.7 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
***.***.***.*** 192.168.1.1 255.255.255.255 UGH 0 0 0 enp3s0
ubuntu@ubuntu:~$ ping -c 1 *.*.*.* (OK)
ubuntu@ubuntu:~$ ping -c 1 google.com (OK)
OK OK )))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment