mirror of https://github.com/bjdgyc/anylink.git
增加默认路由
This commit is contained in:
parent
5bd55d1fa8
commit
8187fb548f
|
@ -68,17 +68,24 @@ func SetGroup(g *Group) error {
|
|||
clientDns := []ValData{}
|
||||
for _, v := range g.ClientDns {
|
||||
if v.Val != "" {
|
||||
ip := net.ParseIP(v.Val)
|
||||
if ip.String() != v.Val {
|
||||
return errors.New("DNS IP 错误")
|
||||
}
|
||||
clientDns = append(clientDns, v)
|
||||
}
|
||||
}
|
||||
if len(clientDns) == 0 {
|
||||
return errors.New("DNS 错误")
|
||||
return errors.New("必须设置一个DNS")
|
||||
}
|
||||
g.ClientDns = clientDns
|
||||
|
||||
routeInclude := []ValData{}
|
||||
for _, v := range g.RouteInclude {
|
||||
if v.Val != "" {
|
||||
if v.Val == "all" {
|
||||
continue
|
||||
}
|
||||
ipMask, _, err := parseIpNet(v.Val)
|
||||
if err != nil {
|
||||
return errors.New("RouteInclude 错误" + err.Error())
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -319,7 +319,7 @@ export default {
|
|||
status: 1,
|
||||
allow_lan: true,
|
||||
client_dns: [{val: '114.114.114.114'}],
|
||||
route_include: [],
|
||||
route_include: [{val: 'all', note: '默认全局代理'}],
|
||||
route_exclude: [],
|
||||
link_acl: [],
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue