Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
USB connected router
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Wed Jul 18, 2012 9:17 pm    Post subject: USB connected router Reply with quote

I using D-Link DSL-2520U router with 2 output ports (the first for ethernet cable, the second - for usb cable)
I want to establish usb connection. So what I did:
Kernel was rebuilt with module cdc_ether and networkmanager was installed.
In networkmanager I added new wired connection eth1 and configured this connection manually:
Code:
IP Address: 192.168.1.4
Subnet Mask: 255.255.255.0
Gateway: 192.168.1.1
DNS Server: 192.168.1.1
IPv6: disabled
Restrict to Interface: eth1


All the settings the same as for eth0 except IP (192.168.1.2)
When I connecting to Connection eth1 networkmanager shows that connection established and shows connection parameters that exactly matches my settings for eth1.
But I can't connect neither to internet nor router (ping 192.168.1.1 says: destination unreachable)

Here ifconfig output for eth1:

Code:
Link encap: Ethernet HWaddr 1c:af:f7:31:c1:dc
inet addr: 192.168.1.4 Bcast: 192.168.1.255 Mask: 255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets: 0 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 0 errors: 0 dropped: 0 overruns: 0 carrier: 0
collision: 0 txqueuelen: 1000
RX bytes: 0 (0.0 B) TX bytes: 0 (0.0 B)


Can anyone explain what is incorrect with eth1 settings?

Thanks in advance for any help.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 46313
Location: 56N 3W

PostPosted: Wed Jul 18, 2012 10:14 pm    Post subject: Reply with quote

creaker,

Please post the output of route when eth1 has an IP address.

Do you connect both eth0 and eth1 to the router at the same time od is eth0 unplugged?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Thu Jul 19, 2012 8:01 am    Post subject: Reply with quote

Thanks for reply, Neddy
route output here:
Code:
gentoo ~ # route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.1.1     0.0.0.0         UG    0      0        0 eth1
default         192.168.1.1     0.0.0.0         UG    3      0        0 eth0
loopback        gentoo.homenetw 255.0.0.0       UG    0      0        0 lo
192.168.1.0     *               255.255.255.0   U     0      0        0 eth0
192.168.1.0     *               255.255.255.0   U     1      0        0 eth1


Only usb cable plugged in (eth1).
Also networkmanager shows that eth0 interface cable unplugged
.
P.S.

Also I see a strange ping output:

Code:
gentoo ~ # ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data
From 192.168.1.2: icmp_seq=1 Destination Host Unreachable
From 192.168.1.2: icmp_seq=2 Destination Host Unreachable


Why ping outcoming from 192.168.1.2 ?
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Thu Jul 19, 2012 11:21 am    Post subject: Reply with quote

I assumed that the net.eth0 interface is on and interferes with net.eth1 and stopped him: /etc/init.d/net.eth0 stop.
Also I removed both eth0 and eth1 from default runlevel. Now when I booting eth0 is off but eth1 is on and I can access internet via eth1. I'm not pretty sure but I think eth1 activated by networkmanager. Also if I connecting both cables, networkmanager shows that both interfaces are activated. I can disconnect either of the two cables and working with one cable plugged in.
It is exactly the same behavior as at my Debian desktop.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 46313
Location: 56N 3W

PostPosted: Thu Jul 19, 2012 6:26 pm    Post subject: Reply with quote

creaker,

Routing rules are applied from from the bottom of the routing table up. So packets to 192.168.1.0/24, your local network, are routed using
Code:
192.168.1.0     *               255.255.255.0   U     1      0        0 eth1
Thats your USB ethernet, so all is good.
Packets to the internet are routed using
Code:
 default         192.168.1.1     0.0.0.0         UG    3      0        0 eth0
which is not so good, as thats your normal wired network, which you say is unplugged.

There are a few issues with your setup. You may not have two interfaces in the same subnet as you do here and you may have at most, a single defualt route, since only the first one encountered in the routing table will ever be used.

For testing, get the system into the same state as it was when you made ran the route command.
Now run
Code:
/etc/init.d/net.eth0 stop
This will stop your eth0 and remove all of its routes from the routing table.

Your internet over USB should now work. This is not yet a fix. I need to understand what you want from your two network interfaces to decide how to provide the network functionality you want.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Thu Jul 19, 2012 7:39 pm    Post subject: Reply with quote

Yes I run route at my Debian and noticed the count of interfaces less that at Gentoo.

What exactly I want from my network interfaces? I have a router with two ports only, lan and usb.
I need ability to connect to my router two PCs simultaneously. One of them is my desktop PC. The second PC (casual PC from clients) may have or may not have USB network interface established (usually have not).
So for my PC I should to have at least USB connection established, in order to keep lan connection for other PCc that (may be) can not connect to router via usb.

Since I removed eth0 from autostart, I can choose any connection type that I need: via usb or lan cable. Both working fine.
Now I thinking what to do: let my Gentoo to work with both interfaces, even if networking configured not very good or reinstall my networking in "true way"?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum