Using two or more network interface in Ubuntu
I have two or more network interface at the same time and want to use each network for sending special requests over it.
for example :
I want to see a video by "network-1" and other requests I want to send with "network-2"
ifconfig
output:
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
and my IP route is
ip route show
output:
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
at that time wlp2s0 and enx0c5b8f279a64 are my two network interface and my data sends default through wlp2s0.
I want to send some of my requests (e.g. YouTube.com) through enx0c5b8f279a64 and others through wlp2s0.
I think this is a good idea (maybe)
I think (probably) opening a port in local for forwarding my packets to one of them (i.e. enx0c5b8f279a64) is a good idea (but I don't know other ways)
then i can set my browser proxy on this ip/port (i.e. 'localhost'/'a_port') and set up its setting to use this proxy just for YouTube.com
networking internet proxy interface
add a comment |
I have two or more network interface at the same time and want to use each network for sending special requests over it.
for example :
I want to see a video by "network-1" and other requests I want to send with "network-2"
ifconfig
output:
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
and my IP route is
ip route show
output:
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
at that time wlp2s0 and enx0c5b8f279a64 are my two network interface and my data sends default through wlp2s0.
I want to send some of my requests (e.g. YouTube.com) through enx0c5b8f279a64 and others through wlp2s0.
I think this is a good idea (maybe)
I think (probably) opening a port in local for forwarding my packets to one of them (i.e. enx0c5b8f279a64) is a good idea (but I don't know other ways)
then i can set my browser proxy on this ip/port (i.e. 'localhost'/'a_port') and set up its setting to use this proxy just for YouTube.com
networking internet proxy interface
add a comment |
I have two or more network interface at the same time and want to use each network for sending special requests over it.
for example :
I want to see a video by "network-1" and other requests I want to send with "network-2"
ifconfig
output:
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
and my IP route is
ip route show
output:
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
at that time wlp2s0 and enx0c5b8f279a64 are my two network interface and my data sends default through wlp2s0.
I want to send some of my requests (e.g. YouTube.com) through enx0c5b8f279a64 and others through wlp2s0.
I think this is a good idea (maybe)
I think (probably) opening a port in local for forwarding my packets to one of them (i.e. enx0c5b8f279a64) is a good idea (but I don't know other ways)
then i can set my browser proxy on this ip/port (i.e. 'localhost'/'a_port') and set up its setting to use this proxy just for YouTube.com
networking internet proxy interface
I have two or more network interface at the same time and want to use each network for sending special requests over it.
for example :
I want to see a video by "network-1" and other requests I want to send with "network-2"
ifconfig
output:
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
and my IP route is
ip route show
output:
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
at that time wlp2s0 and enx0c5b8f279a64 are my two network interface and my data sends default through wlp2s0.
I want to send some of my requests (e.g. YouTube.com) through enx0c5b8f279a64 and others through wlp2s0.
I think this is a good idea (maybe)
I think (probably) opening a port in local for forwarding my packets to one of them (i.e. enx0c5b8f279a64) is a good idea (but I don't know other ways)
then i can set my browser proxy on this ip/port (i.e. 'localhost'/'a_port') and set up its setting to use this proxy just for YouTube.com
networking internet proxy interface
networking internet proxy interface
edited Jan 22 at 10:06
mohammadreza salehi
asked Jan 15 at 1:03
mohammadreza salehimohammadreza salehi
13
13
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
A proxy is the solution to your goal, yes. As a far I know squid should you permit to redirect traffic based on the destination URL and also to define the outgoing address.
For examples, to set the outgoing address for youtube the squid acl will like some think like:
....
acl viaVideo dstdomain youtube.com
tcp_outgoing_address 192.168.1.1 viaVideo
....
the previously rules will says to squid to send via 192.168.1.1 all request performed to youtube.com
Can you explain that in more detail?
– mohammadreza salehi
Jan 15 at 11:36
I add you a configuration example, hope is enough.
– AtomiX84
Jan 15 at 12:31
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1109782%2fusing-two-or-more-network-interface-in-ubuntu%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
A proxy is the solution to your goal, yes. As a far I know squid should you permit to redirect traffic based on the destination URL and also to define the outgoing address.
For examples, to set the outgoing address for youtube the squid acl will like some think like:
....
acl viaVideo dstdomain youtube.com
tcp_outgoing_address 192.168.1.1 viaVideo
....
the previously rules will says to squid to send via 192.168.1.1 all request performed to youtube.com
Can you explain that in more detail?
– mohammadreza salehi
Jan 15 at 11:36
I add you a configuration example, hope is enough.
– AtomiX84
Jan 15 at 12:31
add a comment |
A proxy is the solution to your goal, yes. As a far I know squid should you permit to redirect traffic based on the destination URL and also to define the outgoing address.
For examples, to set the outgoing address for youtube the squid acl will like some think like:
....
acl viaVideo dstdomain youtube.com
tcp_outgoing_address 192.168.1.1 viaVideo
....
the previously rules will says to squid to send via 192.168.1.1 all request performed to youtube.com
Can you explain that in more detail?
– mohammadreza salehi
Jan 15 at 11:36
I add you a configuration example, hope is enough.
– AtomiX84
Jan 15 at 12:31
add a comment |
A proxy is the solution to your goal, yes. As a far I know squid should you permit to redirect traffic based on the destination URL and also to define the outgoing address.
For examples, to set the outgoing address for youtube the squid acl will like some think like:
....
acl viaVideo dstdomain youtube.com
tcp_outgoing_address 192.168.1.1 viaVideo
....
the previously rules will says to squid to send via 192.168.1.1 all request performed to youtube.com
A proxy is the solution to your goal, yes. As a far I know squid should you permit to redirect traffic based on the destination URL and also to define the outgoing address.
For examples, to set the outgoing address for youtube the squid acl will like some think like:
....
acl viaVideo dstdomain youtube.com
tcp_outgoing_address 192.168.1.1 viaVideo
....
the previously rules will says to squid to send via 192.168.1.1 all request performed to youtube.com
edited Jan 15 at 12:23
answered Jan 15 at 10:08
AtomiX84AtomiX84
680110
680110
Can you explain that in more detail?
– mohammadreza salehi
Jan 15 at 11:36
I add you a configuration example, hope is enough.
– AtomiX84
Jan 15 at 12:31
add a comment |
Can you explain that in more detail?
– mohammadreza salehi
Jan 15 at 11:36
I add you a configuration example, hope is enough.
– AtomiX84
Jan 15 at 12:31
Can you explain that in more detail?
– mohammadreza salehi
Jan 15 at 11:36
Can you explain that in more detail?
– mohammadreza salehi
Jan 15 at 11:36
I add you a configuration example, hope is enough.
– AtomiX84
Jan 15 at 12:31
I add you a configuration example, hope is enough.
– AtomiX84
Jan 15 at 12:31
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1109782%2fusing-two-or-more-network-interface-in-ubuntu%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown