diff --git a/SSHCommand/RunSSH.go b/SSHCommand/RunSSH.go index 52ade29..092a95d 100644 --- a/SSHCommand/RunSSH.go +++ b/SSHCommand/RunSSH.go @@ -221,7 +221,9 @@ func (s *SSHClass) RunSetNetwork(ip string, dnsArr string, netmask, gateway stri cmd += fmt.Sprintf(" && uci set %sndp=relay", if4) cmd += fmt.Sprintf(" && uci set %smaster=1", if4) - cmd += fmt.Sprintf(" && uci delete %sdns", if4) + cmd += fmt.Sprintf(" && uci add_list %sdns=::1", if4) // 此行必须添加,否则可能因为不存在list而导致错误 + cmd += fmt.Sprintf(" && uci add_list %sdns=::2", if4) // 此行必须添加,否则可能因为不存在list而导致错误 + cmd += fmt.Sprintf(" && uci delete %sdns", if4) // 使用delete命令删除整个列表 cmd += fmt.Sprintf(" && uci add_list %sdns=2606:4700:4700::1111", if4) cmd += fmt.Sprintf(" && uci add_list %sdns=2001:4860:4860::8888", if4) @@ -229,6 +231,11 @@ func (s *SSHClass) RunSetNetwork(ip string, dnsArr string, netmask, gateway stri if5 := "/etc/config/dhcp.wan." // dhcp wan cmd += fmt.Sprintf(" && uci set %signore=1", if5) + log.Info("Delete lan IPV6 Assign") + if6 := "/etc/config/network.lan." + cmd += fmt.Sprintf(" && uci set %sip6assign=60", if6) // 用于保证选项存在 + cmd += fmt.Sprintf(" && uci delete %sip6assign", if6) + cmd += fmt.Sprintf(" && service network restart") s.RunCommand(cmd) log.Info("SetNetwork finished") diff --git a/ScutLog.log b/ScutLog.log index bcf7c5b..62d2bb7 100644 --- a/ScutLog.log +++ b/ScutLog.log @@ -1,3 +1,3 @@ -{"time":"2023-11-04T17:29:19.0832432+08:00","level":"ERROR","prefix":"-","file":"RunSSH.go","line":"55","message":"ssh: handshake failed: EOF"} -{"time":"2023-11-04T17:29:19.1396842+08:00","level":"ERROR","prefix":"-","file":"RunSSH.go","line":"35","message":"Dial Fails: ssh: handshake failed: EOF"} -{"time":"2023-11-04T17:29:19.1396842+08:00","level":"ERROR","prefix":"-","file":"RunSSH.go","line":"67","message":"New Session Fails: ssh: handshake failed: EOF"} +{"time":"2023-11-04T21:23:32.4961224+08:00","level":"ERROR","prefix":"-","file":"RunSSH.go","line":"55","message":"dial tcp 192.168.1.101:22: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond."} +{"time":"2023-11-04T21:23:32.5106611+08:00","level":"ERROR","prefix":"-","file":"RunSSH.go","line":"35","message":"Dial Fails: dial tcp 192.168.1.101:22: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond."} +{"time":"2023-11-04T21:23:32.5106611+08:00","level":"ERROR","prefix":"-","file":"RunSSH.go","line":"67","message":"New Session Fails: dial tcp 192.168.1.101:22: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond."}