OpenWrt Forum Archive

Topic: make all the traffic originated from host machine go through OpenVPN

The content of this topic has been archived on 29 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi all,

I installed the OpenVPN on OpenWRT and this 'OpenWRT' is a virtual machine (I deployed it on the VirtualBox). All the traffic originates from Windows PC will go through this "virtual OpenWRT", just as shown bellow:

Windows PC <----> Virtual OpenWRT(with OpenVPN installed on it) <----internet----> OpenVPN server <----> Real destination

Then i type ping 10.66.77.1 in the Windows cmd, I get reply form the server. After this, I try to browse some website, but the web traffic go through the normal gateway not the OpenVPN tunnel, so I make some modification to the route table using the 'ip route' command:

ip route add Server IP via 192.168.1.1
ip route change default via 10.66.77.5

Then I try to browse some websites again, but this time the websites cannot even be opened due to DNS problem ( the domain name can't be resolved to a ip address). Bellow is the output of some file:

root@OpenWrt:~# cat /etc/config/network

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config interface 'lan'
        option ifname 'eth0'
        option type 'bridge'
        option proto 'static'
        option ipaddr '192.168.144.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config interface 'wan'
        option ifname 'eth1'
        option proto 'dhcp'

config interface 'wan6'
        option ifname 'eth1'
        option proto 'dhcpv6'

config globals 'globals'
        option ula_prefix 'fd71:5965:fbdb::/48'

Thanks

(Last edited by GabriellaQuevedo on 27 Oct 2017, 03:02)

The discussion might have continued from here.