동시에 두 개 이상의 네트워크 인터페이스가 있고 각 네트워크를 사용하여 이를 통해 특별한 요청을 보내고 싶습니다. (iptables 및 기타 유사한 방법을 사용하여 이 작업을 수행하는 방법을 알고 싶습니다)
예를 들어: "network-1"의 영상을 보고 싶고, "network-2"를 통해 다른 요청을 보내고 싶습니다.
ifconfig
산출:
enx0c5b8f279a64: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.8.100 netmask 255.255.255.0 broadcast 192.168.8.255
inet6 fe80::af19:e5c2:350e:ad09 prefixlen 64 scopeid 0x20<link>
ether 0c:5b:8f:27:9a:64 txqueuelen 1000 (Ethernet)
RX packets 74 bytes 16183 (16.1 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 122 bytes 16282 (16.2 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 5290686 bytes 3859055101 (3.8 GB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 5290686 bytes 3859055101 (3.8 GB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ppp0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1400
inet 81.31.179.204 netmask 255.255.255.255 destination 172.17.1.230
ppp txqueuelen 3 (Point-to-Point Protocol)
RX packets 292544 bytes 336720863 (336.7 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 178723 bytes 16928573 (16.9 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.2 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::a71b:2220:7e40:1948 prefixlen 64 scopeid 0x20<link>
ether e4:70:b8:cf:4f:81 txqueuelen 1000 (Ethernet)
RX packets 4691632 bytes 4626078058 (4.6 GB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4675065 bytes 704065262 (704.0 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
내 IP 라우팅은
ip route show
산출:
default dev ppp0 proto static scope link metric 50
default via 192.168.8.1 dev enx0c5b8f279a64 proto dhcp metric 20100
default via 192.168.1.1 dev wlp2s0 proto dhcp metric 20600
169.254.0.0/16 dev wlp2s0 scope link metric 1000
172.17.1.230 via 192.168.1.1 dev wlp2s0 src 192.168.1.2
172.17.1.230 dev ppp0 proto kernel scope link src 81.31.179.204 metric 50
172.17.1.230 via 192.168.1.1 dev wlp2s0 proto static metric 600
192.168.1.0/24 dev wlp2s0 proto kernel scope link src 192.168.1.2 metric 600
192.168.1.1 dev wlp2s0 proto static scope link metric 600
192.168.8.0/24 dev enx0c5b8f279a64 proto kernel scope link src
192.168.8.100 metric 100
그 당시 내 네트워크 인터페이스 wlp2s0
는 모두enx0c5b8f279a64
enx0c5b8f279a64
(프록시에서 브라우저를 설정하여 지정됨)을 통해 일부 요청을 보내고 싶습니다 wlp2s0
.