K
K
krll-k2014-11-16 17:43:04
linux
krll-k, 2014-11-16 17:43:04

How to control traffic, is there a usb0 interface besides eth0?

All devices at home are connected through one common router (which in turn connects via pppoe to the servers of the local provider:

[email protected]:~$ traceroute toster.ru
traceroute to toster.ru (178.248.236.52), 30 hops max, 60 byte packets
 1  router.asus.com (192.168.1.1)  0.579 ms  1.344 ms  1.147 ms
 2  10.91.255.126 (10.91.255.126)  5.658 ms  6.022 ms  6.321 ms
 3  lag-6-435.bbr01.nn.ertelecom.ru (91.144.153.98)  13.886 ms  14.341 ms  14.484 ms
 4  * * *
 5  mskn08.transtelecom.net (188.43.11.122)  22.468 ms  22.531 ms  22.759 ms
 6  * * *
 7  HLL-gw.transtelecom.net (217.150.47.233)  19.652 ms  19.334 ms  19.539 ms
 8  * * *
 9  * * *
10  * * *
11  * * *
12  * * *
13  * * *
14  * * *
15  * * *
16  * * *
17  * * *
18  * * *
19  * * *
20  * * *
21  * * *
22  * * *
23  * * *
24  * * *
25  * * *
26  * * *
27  * * *
28  * * *
29  * * *
30  * * *

In addition to Ethernet / RJ45, an Android phone is connected to the computer (it is used as a wifi / usb modem):
[email protected]:~$ ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:1a:4d:91:2b:c0  
          inet addr:192.168.1.153  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: ::5f4e:15dd:1c1c:7a20:fc5a:5b79/64 Scope:Global
          inet6 addr: fe80::21a:4dff:fe91:2bc0/64 Scope:Link
          inet6 addr: ::5f4e:15dd:21a:4dff:fe91:2bc0/64 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:22057 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10689 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:28831308 (28.8 MB)  TX bytes:1286317 (1.2 MB)

[email protected]:~$ ifconfig usb0
usb0      Link encap:Ethernet  HWaddr 0e:d2:6d:8b:88:74  
          inet addr:192.168.42.53  Bcast:192.168.42.255  Mask:255.255.255.0
          inet6 addr: fe80::cd2:6dff:fe8b:8874/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:29 errors:0 dropped:0 overruns:0 frame:0
          TX packets:78 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2885 (2.8 KB)  TX bytes:12885 (12.8 KB)

Having done a path tracing (you can see that all traffic goes through eth0):
[email protected]:~$ traceroute 192.168.1.1
traceroute to 192.168.1.1 (192.168.1.1), 30 hops max, 60 byte packets
 1  router.asus.com (192.168.1.1)  0.517 ms  0.470 ms  1.027 ms
[email protected]:~$ ip route
default via 192.168.1.1 dev eth0  proto static 
192.168.1.0/24 dev eth0  proto kernel  scope link  src 192.168.1.153  metric 1 
192.168.42.0/24 dev usb0  proto kernel  scope link  src 192.168.42.53  metric 1 
[email protected]:~$ traceroute 192.168.42.1
traceroute to 192.168.42.1 (192.168.42.1), 30 hops max, 60 byte packets
 1  ii (192.168.42.53)  2998.310 ms !H  2998.231 ms !H  2998.217 ms !H

How to make traffic pass through the usb0 interface? (while eth0 must remain active)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Spetros, 2014-11-16
@krll-k

How to make traffic pass through the usb0 interface? (while eth0 must remain active)

In the routing table, use usb0 instead of eth0 as the default gateway.
Enter something like:
ip route add default via 192.168.42.1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question