Eu tenho um servidor Ubuntu como roteador. Agora gostaria de rotear todo o tráfego da sub-rede 1 (192.168.1.0) por meio de uma conexão vpn. Isso funciona apenas quando eu deixo o servidor vpn empurrar as rotas para o meu roteador, mas agora a subnet2 (192.168.2.0) e o tráfego vindo do roteador em si também são tunelados através da VPN.
Alguém pode me dizer como definir as rotas para que apenas o tráfego da subnet1 vá para a conexão vpn e o tráfego da subnet2 e do próprio servidor vá diretamente para a internet?
Tabela de roteamento sem vpn:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 31.19.38.254 0.0.0.0 UG 0 0 0 eth0
31.19.38.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.128 U 0 0 0 p1p1
192.168.2.0 0.0.0.0 255.255.255.128 U 0 0 0 p1p2
com o vpn push-gateway ativado
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.9.0.41 128.0.0.0 UG 0 0 0 tun0
0.0.0.0 31.19.38.254 0.0.0.0 UG 0 0 0 eth0
10.9.0.1 10.9.0.41 255.255.255.255 UGH 0 0 0 tun0
10.9.0.41 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
31.19.38.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
128.0.0.0 10.9.0.41 128.0.0.0 UG 0 0 0 tun0
192.168.1.0 0.0.0.0 255.255.255.128 U 0 0 0 p1p1
192.168.2.0 0.0.0.0 255.255.255.128 U 0 0 0 p1p2
209.95.51.97 31.19.38.254 255.255.255.255 UGH 0 0 0 eth0
Interfaces:
eth0 Link encap:Ethernet HWaddr d0:50:99:26:c9:62
inet addr:31.19.38.94 Bcast:31.19.38.255 Mask:255.255.255.0
inet6 addr: fe80::d250:99ff:fe26:c962/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
p1p1 Link encap:Ethernet HWaddr 00:15:17:94:4c:16
inet addr:192.168.1.1 Bcast:192.168.1.127 Mask:255.255.255.128
inet6 addr: fe80::215:17ff:fe94:4c16/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
p1p2 Link encap:Ethernet HWaddr 00:15:17:94:4c:17
inet addr:192.168.2.1 Bcast:192.168.2.127 Mask:255.255.255.128
inet6 addr: fe80::215:17ff:fe94:4c17/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.9.0.54 P-t-P:10.9.0.53 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1