chore: replace route 0.0.0.0/0 with default

This commit is contained in:
mzz2017 2023-02-07 00:17:55 +08:00
parent 9b38fa97e6
commit 6f1ec9a4d6
2 changed files with 4 additions and 4 deletions

View File

@ -121,7 +121,7 @@ func (c *ControlPlaneCore) BindLan(ifname string) error {
var output []byte
if output, err = exec.Command("sh", "-c", `
ip rule add fwmark 0x80000000/0x80000000 table 2023
ip route add local 0.0.0.0/0 dev lo table 2023
ip route add local default dev lo table 2023
ip -6 rule add fwmark 0x80000000/0x80000000 table 2023
ip -6 route add local ::/0 dev lo table 2023
`).CombinedOutput(); err != nil {
@ -130,7 +130,7 @@ func (c *ControlPlaneCore) BindLan(ifname string) error {
c.deferFuncs = append(c.deferFuncs, func() error {
return exec.Command("sh", "-c", `
ip rule del fwmark 0x80000000/0x80000000 table 2023
ip route del local 0.0.0.0/0 dev lo table 2023
ip route del local default dev lo table 2023
ip -6 rule del fwmark 0x80000000/0x80000000 table 2023
ip -6 route del local ::/0 dev lo table 2023
`).Run()

View File

@ -1179,12 +1179,12 @@ int tproxy_lan_ingress(struct __sk_buff *skb) {
/**
ip rule add fwmark 0x80000000/0x80000000 table 2023
ip route add local 0.0.0.0/0 dev lo table 2023
ip route add local default dev lo table 2023
ip -6 rule add fwmark 0x80000000/0x80000000 table 2023
ip -6 route add local ::/0 dev lo table 2023
ip rule del fwmark 0x80000000/0x80000000 table 2023
ip route del local 0.0.0.0/0 dev lo table 2023
ip route del local default dev lo table 2023
ip -6 rule del fwmark 0x80000000/0x80000000 table 2023
ip -6 route del local ::/0 dev lo table 2023
*/