首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Ubuntu中使用两个或多个网络接口

在Ubuntu中使用两个或多个网络接口
EN

Ask Ubuntu用户
提问于 2019-01-15 01:03:08
回答 1查看 406关注 0票数 1

我有两个或两个以上的网络接口在同一时间,并希望使用每个网络发送特殊的请求通过它。

for示例:我希望看到一个由"network-1“和其他我想用"network-2”发送的请求的视频

代码语言:javascript
复制
ifconfig

产出:

代码语言:javascript
复制
enx0c5b8f279a64: flags=4163  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
    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  mtu 65536
    inet 127.0.0.1  netmask 255.0.0.0
    inet6 ::1  prefixlen 128  scopeid 0x10
    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  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  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
    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路线是

代码语言:javascript
复制
ip route show

产出:

代码语言:javascript
复制
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 

当时,wlp2s0enx0c5b8f279a64是我的两个网络接口,我的数据通过wlp2s0发送默认值。

我想通过enx0c5b8f279a64发送一些请求(例如D9),另一些通过wlp2s0发送。

I认为这是个好主意(也许)

我认为(可能)在本地打开一个端口以便将我的包转发给其中一个(即enx0c5b8f279a64)是个好主意(但我不知道其他方法),然后我可以在这个ip/端口(即'localhost'/'a_ port ')上设置我的浏览器代理,并设置它的设置来使用这个代理仅用于YouTube.com。

EN

回答 1

Ask Ubuntu用户

发布于 2019-01-15 10:08:33

代理是你的目标的解决方案,是的。据我所知,squid应该允许基于目标URL的流量重定向,也可以定义传出地址。

例如,要设置youtube的传出地址,squid会像一些人想的那样:

代码语言:javascript
复制
....
acl viaVideo dstdomain youtube.com
tcp_outgoing_address 192.168.1.1 viaVideo
....

以前的规则将要求squid通过192.168.1.1向youtube.com发送所有执行的请求

票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1109782

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档