{"action":"created","issue":{"url":"https://api.github.com/repos/clowwindy/ShadowVPN/issues/89","labels_url":"https://api.github.com/repos/clowwindy/ShadowVPN/issues/89/labels{/name}","comments_url":"https://api.github.com/repos/clowwindy/ShadowVPN/issues/89/comments","events_url":"https://api.github.com/repos/clowwindy/ShadowVPN/issues/89/events","html_url":"https://github.com/clowwindy/ShadowVPN/issues/89","id":55862466,"number":89,"title":"提供另一种路由覆盖方式","user":{"login":"SaberSalv","id":2525544,"avatar_url":"https://avatars.githubusercontent.com/u/2525544?v=3","gravatar_id":"","url":"https://api.github.com/users/SaberSalv","html_url":"https://github.com/SaberSalv","followers_url":"https://api.github.com/users/SaberSalv/followers","following_url":"https://api.github.com/users/SaberSalv/following{/other_user}","gists_url":"https://api.github.com/users/SaberSalv/gists{/gist_id}","starred_url":"https://api.github.com/users/SaberSalv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SaberSalv/subscriptions","organizations_url":"https://api.github.com/users/SaberSalv/orgs","repos_url":"https://api.github.com/users/SaberSalv/repos","events_url":"https://api.github.com/users/SaberSalv/events{/privacy}","received_events_url":"https://api.github.com/users/SaberSalv/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-01-29T06:35:51Z","updated_at":"2015-01-30T05:05:30Z","closed_at":"2015-01-30T04:36:04Z","body":"OpenVPN有多种方式:\r\n\r\n```\r\n--redirect-gateway flags...\r\n(Experimental) Automatically execute routing commands to cause all outgoing IP traffic to be redirected over the VPN.\r\nThis option performs three steps:\r\n\r\n(1) Create a static route for the --remote address which forwards to the pre-existing default gateway. This is done so that (3) will not create a routing loop.\r\n\r\n(2) Delete the default gateway route.\r\n\r\n(3) Set the new default gateway to be the VPN endpoint address (derived either from --route-gateway or the second parameter to --ifconfig when --dev tun is specified).\r\n\r\nWhen the tunnel is torn down, all of the above steps are reversed so that the original default route is restored.\r\n\r\nOption flags:\r\n\r\nlocal -- Add the local flag if both OpenVPN servers are directly connected via a common subnet, such as with wireless. The local flag will cause step 1 above to be omitted.\r\n\r\ndef1 -- Use this flag to override the default gateway by using 0.0.0.0/1 and 128.0.0.0/1 rather than 0.0.0.0/0. This has the benefit of overriding but not wiping out the original default gateway.\r\n\r\nbypass-dhcp -- Add a direct route to the DHCP server (if it is non-local) which bypasses the tunnel (Available on Windows clients, may not be available on non-Windows clients).\r\n\r\nbypass-dns -- Add a direct route to the DNS server(s) (if they are non-local) which bypasses the tunnel (Available on Windows clients, may not be available on non-Windows clients).\r\n\r\nUsing the def1 flag is highly recommended.\r\n```\r\n\r\n我希望能提供def1模式, 也是OpenVPN的默认设置\r\n\r\n```\r\ndef1 -- Use this flag to override the default gateway by using 0.0.0.0/1 and 128.0.0.0/1 rather than 0.0.0.0/0. This has the benefit of overriding but not wiping out the original default gateway.\r\n\r\nip route add <remote>/32 via 192.168.1.1                                        \r\nip route add 0.0.0.0/1 via 10.8.0.5                                             \r\nip route add 128.0.0.0/1 via 10.8.0.5\r\n```\r\n\r\n这样我就可以使用[freedom-routes](https://github.com/SaberSalv/freedom-routes) 或 [chnroutes](https://github.com/fivesheep/chnroutes) 了， 比[文档里面的方法](https://github.com/clowwindy/ShadowVPN/wiki/Using-chnroutes)更好。\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/clowwindy/ShadowVPN/issues/comments/72154778","html_url":"https://github.com/clowwindy/ShadowVPN/issues/89#issuecomment-72154778","issue_url":"https://api.github.com/repos/clowwindy/ShadowVPN/issues/89","id":72154778,"user":{"login":"clowwindy","id":1073082,"avatar_url":"https://avatars.githubusercontent.com/u/1073082?v=3","gravatar_id":"","url":"https://api.github.com/users/clowwindy","html_url":"https://github.com/clowwindy","followers_url":"https://api.github.com/users/clowwindy/followers","following_url":"https://api.github.com/users/clowwindy/following{/other_user}","gists_url":"https://api.github.com/users/clowwindy/gists{/gist_id}","starred_url":"https://api.github.com/users/clowwindy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clowwindy/subscriptions","organizations_url":"https://api.github.com/users/clowwindy/orgs","repos_url":"https://api.github.com/users/clowwindy/repos","events_url":"https://api.github.com/users/clowwindy/events{/privacy}","received_events_url":"https://api.github.com/users/clowwindy/received_events","type":"User","site_admin":false},"created_at":"2015-01-30T05:05:30Z","updated_at":"2015-01-30T05:05:30Z","body":"@aa65535  好了。\r\nchnroutes.sh 最后貌似多了个 EOF"}}