From b4d4dc251d17fec4b008073d50f11705bbdb894a Mon Sep 17 00:00:00 2001 From: gVisor bot Date: Sun, 9 Oct 2022 10:48:26 +0800 Subject: [PATCH] fix: try let fakeip mode get real destination ip --- component/fakeip/pool.go | 2 +- config/config.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/component/fakeip/pool.go b/component/fakeip/pool.go index 0137f705..58a75a94 100644 --- a/component/fakeip/pool.go +++ b/component/fakeip/pool.go @@ -166,7 +166,7 @@ func New(options Options) (*Pool, error) { var ( hostAddr = options.IPNet.Masked().Addr() gateway = hostAddr.Next() - first = gateway.Next().Next() + first = gateway.Next().Next().Next() // default start with 198.18.0.4 last = nnip.UnMasked(*options.IPNet) ) diff --git a/config/config.go b/config/config.go index 1a0cbc96..ac5f4a1e 100644 --- a/config/config.go +++ b/config/config.go @@ -1138,6 +1138,7 @@ func parseTun(rawTun RawTun, general *General, dnsCfg *DNS) (*Tun, error) { } else { tunAddressPrefix = netip.MustParsePrefix("198.18.0.1/16") } + tunAddressPrefix = netip.PrefixFrom(tunAddressPrefix.Addr(), 30) return &Tun{ Enable: rawTun.Enable,