diff --git a/proxy/tun/handler.go b/proxy/tun/handler.go index 1e8e030e6..a177ba40a 100644 --- a/proxy/tun/handler.go +++ b/proxy/tun/handler.go @@ -80,6 +80,12 @@ func (t *Handler) Init(ctx context.Context, pm policy.Manager, dispatcher routin return nil } return c.Control(func(fd uintptr) { + _, ipStr, _ := net.SplitHostPort(address) + ip := net.ParseIP(ipStr) + // skip loopback + if ip != nil && ip.IsLoopback() { + return + } err := setinterface(network, address, fd, iface) if err != nil { errors.LogInfoInner(context.Background(), err, "[tun] falied to set interface")