我根据此处Musclehead 的回答修改了我的 iptables,以便我transmission-daemon
可以将传出流量发送到tun0
(这是一个 VPN)。
(提示:我eth0
的被称为enp3s0
。)
现在,如果我添加一个 torrent下载并且我观察流量,sudo iptables -L -v
唯一增加的数字与INPUT
链相关enp3s0
(这是我的以太网端口)。这些数字与我从 VPN 获得的状态相加。
这是否意味着我下载到我原来的 WAN 地址而不是隧道?
我认为当我添加一个 torrent 时,有关下载它的信息将被发送,tun0
因此答案应该回到那个 IP 范围。
正如您在此处看到的,我生成的两个输出相隔几秒钟,设备上的流量从1356M
到增加。2201M
enp3s0
$ sudo iptables -L -v
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
2417 172K f2b-sshd tcp -- any any anywhere anywhere multiport dports ssh
170K 17M ACCEPT all -- tun0 any anywhere anywhere
330K 1356M ACCEPT all -- enp3s0 any anywhere --THIS LINE anywhere
942 134K ACCEPT all -- lo any anywhere anywhere
...
Chain OUTPUT (policy ACCEPT 483K packets, 269M bytes)
pkts bytes target prot opt in out source destination
19 6545 ACCEPT tcp -- any enp3s0 anywhere 192.168.100.0/24 tcp spt:9091 owner GID match debian-transmission
0 0 ACCEPT udp -- any enp3s0 anywhere 192.168.100.0/24 udp spt:9091 owner GID match debian-transmission
229K 210M ACCEPT all -- any tun0 anywhere anywhere owner GID match debian-transmission
221 57168 ACCEPT all -- any lo anywhere anywhere owner GID match debian-transmission
92 5372 REJECT all -- any any anywhere anywhere owner GID match debian-transmission reject-with icmp-port-unreachable
...
秒后的第二个输出:
$ sudo iptables -L -v
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
2431 173K f2b-sshd tcp -- any any anywhere anywhere multiport dports ssh
170K 17M ACCEPT all -- tun0 any anywhere anywhere
384K 2201M ACCEPT all -- enp3s0 any anywhere --THIS LINE anywhere
942 134K ACCEPT all -- lo any anywhere anywhere
...
Chain OUTPUT (policy ACCEPT 536K packets, 272M bytes)
pkts bytes target prot opt in out source destination
19 6545 ACCEPT tcp -- any enp3s0 anywhere 192.168.100.0/24 tcp spt:9091 owner GID match debian-transmission
0 0 ACCEPT udp -- any enp3s0 anywhere 192.168.100.0/24 udp spt:9091 owner GID match debian-transmission
229K 210M ACCEPT all -- any tun0 anywhere anywhere owner GID match debian-transmission
221 57168 ACCEPT all -- any lo anywhere anywhere owner GID match debian-transmission
92 5372 REJECT all -- any any anywhere anywhere owner GID match debian-transmission reject-with icmp-port-unreachable
...
我还将添加我的路由表输出以便更好地理解:
$ ip route show table local
broadcast 10.8.8.0 dev tun0 proto kernel scope link src 10.8.8.5
local 10.8.8.5 dev tun0 proto kernel scope host src 10.8.8.5
broadcast 10.8.8.255 dev tun0 proto kernel scope link src 10.8.8.5
broadcast 127.0.0.0 dev lo proto kernel scope link src 127.0.0.1
local 127.0.0.0/8 dev lo proto kernel scope host src 127.0.0.1
local 127.0.0.1 dev lo proto kernel scope host src 127.0.0.1
broadcast 127.255.255.255 dev lo proto kernel scope link src 127.0.0.1
broadcast 192.168.100.0 dev enp3s0 proto kernel scope link src 192.168.100.91
local 192.168.100.91 dev enp3s0 proto kernel scope host src 192.168.100.91
broadcast 192.168.100.255 dev enp3s0 proto kernel scope link src 192.168.100.91