我正在使用在 127.0.0.1:3128 上运行的 squid 代理,我正在尝试路由通过我的代理服务器的所有流量以使用特定的网络适配器。
命令:
iptables -t nat -A PREROUTING --dst 127.0.0.1 -p tcp --dport 3128 -j DNAT --to-destination 192.168.43.76:3128
我尝试了以下操作,但没有成功,192.168.43.76
因为适配器是本地 Ipv4。
ip r show table all
显示:
default via 127.0.0.1 dev lo table 3
default via 192.168.1.254 dev enp4s0 proto dhcp metric 100
default via 192.168.43.1 dev wlp3s0 proto dhcp metric 600
169.254.0.0/16 dev enp4s0 scope link metric 1000
192.168.1.0/24 dev enp4s0 proto kernel scope link src 192.168.1.210 metric 100
192.168.43.0/24 dev wlp3s0 proto kernel scope link src 192.168.43.76 metric 600
broadcast 127.0.0.0 dev lo table local proto kernel scope link src 127.0.0.1
local 127.0.0.0/8 dev lo table local proto kernel scope host src 127.0.0.1
local 127.0.0.1 dev lo table local proto kernel scope host src 127.0.0.1
broadcast 127.255.255.255 dev lo table local proto kernel scope link src 127.0.0.1
broadcast 192.168.1.0 dev enp4s0 table local proto kernel scope link src 192.168.1.210
local 192.168.1.210 dev enp4s0 table local proto kernel scope host src 192.168.1.210
broadcast 192.168.1.255 dev enp4s0 table local proto kernel scope link src 192.168.1.210
broadcast 192.168.43.0 dev wlp3s0 table local proto kernel scope link src 192.168.43.76
local 192.168.43.76 dev wlp3s0 table local proto kernel scope host src 192.168.43.76
broadcast 192.168.43.255 dev wlp3s0 table local proto kernel scope link src 192.168.43.76
2a00:23c7:3c05:7c01::/64 dev enp4s0 proto ra metric 100 pref medium
fe80::/64 dev enp4s0 proto kernel metric 100 pref medium
fe80::/64 dev wlp3s0 proto kernel metric 600 pref medium
default via fe80::8e19:b5ff:fe44:5852 dev enp4s0 proto ra metric 20100 pref medium
local ::1 dev lo table local proto kernel metric 0 pref medium
local 2a00:23c7:3c05:7c01:3763:cf65:958b:dfe9 dev enp4s0 table local proto kernel metric 0 pref medium
local 2a00:23c7:3c05:7c01:d5e5:e0ff:34a5:d2b9 dev enp4s0 table local proto kernel metric 0 pref medium
local fe80::54c1:a358:586:b470 dev wlp3s0 table local proto kernel metric 0 pref medium
local fe80::ae7d:6464:5c50:e88f dev enp4s0 table local proto kernel metric 0 pref medium
multicast ff00::/8 dev enp4s0 table local proto kernel metric 256 pref medium
multicast ff00::/8 dev wlp3s0 table local proto kernel metric 256 pref medium
我正在尝试使用default via 192.168.43.1 dev wlp3s0 proto dhcp metric 600
适配器,它使用 WiFi,同时允许代理之外的所有其他东西仍然使用以太网/默认适配器。