Conflito entre rede local e VPN

0

Estou em uma máquina Linux (Ubuntu 14.04). Minha rede wifi local é 192.168.1.0/24 , mas minha VPN também 192.168.1.0/24 (VPN ponto a ponto).

ifconfig

enp1s0    Link encap:Ethernet  HWaddr 50:7b:9d:98:da:f1  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          Packets reçus:0 erreurs:0 :0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:1000 
          Octets reçus:0 (0.0 B) Octets transmis:0 (0.0 B)

lo        Link encap:Boucle locale  
          inet adr:127.0.0.1  Masque:255.0.0.0
          adr inet6: ::1/128 Scope:Hôte
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          Packets reçus:806 erreurs:0 :0 overruns:0 frame:0
          TX packets:806 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:1 
          Octets reçus:82090 (82.0 KB) Octets transmis:82090 (82.0 KB)

ppp0      Link encap:Protocole Point-à-Point  
          inet adr:192.168.1.205  P-t-P:192.168.1.204  Masque:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1400  Metric:1
          Packets reçus:8 erreurs:0 :0 overruns:0 frame:0
          TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:3 
          Octets reçus:185 (185.0 B) Octets transmis:237 (237.0 B)

wlp2s0    Link encap:Ethernet  HWaddr 08:d4:0c:86:c6:76  
          inet adr:192.168.1.3  Bcast:192.168.1.255  Masque:255.255.255.0
          adr inet6: fd24:df6a:bd78:7b00:8109:a0c4:133a:892b/64 Scope:Global
          adr inet6: fd24:df6a:bd78:7b00:e534:8609:1c44:f40a/64 Scope:Global
          adr inet6: fe80::cdf7:32b8:de5b:ac15/64 Scope:Lien
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Packets reçus:6150 erreurs:0 :0 overruns:0 frame:0
          TX packets:4583 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:1000 
          Octets reçus:5540235 (5.5 MB) Octets transmis:658638 (658.6 KB)

netstat -anr

Table de routage IP du noyau
Destination     Passerelle      Genmask         Indic   MSS Fenêtre irtt Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 wlp2s0
80.13.172.131   192.168.1.1     255.255.255.255 UGH       0 0          0 wlp2s0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 ppp0
192.168.1.0     192.168.1.204   255.255.255.0   UG        0 0          0 ppp0
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 wlp2s0
192.168.1.204   0.0.0.0         255.255.255.255 UH        0 0          0 ppp0

Eu quero redirecionar apenas as solicitações de 192.168.1.39 para a VPN. Como posso fazer isso?

    
por Serhan 07.03.2017 / 10:52

1 resposta

0

Você precisa remover a rota para o dispositivo ppp0:

192.168.1.0     192.168.1.204   255.255.255.0   UG        0 0          0 ppp0

com o seguinte comando:

sudo route del -net 192.168.1.0/24 gw 192.168.1.204

Então você precisa adicionar a rota para 192.168.1.39

sudo route add -host 192.168.1.39 gw 192.168.1.204 dev ppp0
    
por Carl 07.03.2017 / 13:55