Re: [gentoo-user] Net problems

2015-05-15 Thread Mick
On Thursday 14 May 2015 07:34:41 meino.cra...@gmx.de wrote:

> This is what udevadm monitor prints, when I unplug both Ariettas
> simultanously:
> solfire:/home/mccramer>udevadm monitor
> monitor will print the received events for:
> UDEV - the event which udev sends out after rule processing
> KERNEL - the kernel uevent
> 
> KERNEL[13781.884965] remove  
> /devices/pci:00/:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/rx-0
> (queues) KERNEL[13781.885027] remove  
> /devices/pci:00/:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/tx-0
> (queues) KERNEL[13781.885067] remove  
> /devices/pci:00/:00:13.2/usb4/4-4/4-4:1.0/net/usb1 (net) UDEV 
> [13781.886418] remove  
> /devices/pci:00/:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/rx-0
> (queues) KERNEL[13781.889122] remove  
> /devices/pci:00/:00:13.2/usb4/4-4/4-4:1.0 (usb)
> KERNEL[13781.889194] remove   /devices/pci:00/:00:13.2/usb4/4-4
> (usb) UDEV  [13781.902185] remove  
> /devices/pci:00/:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/tx-0
> (queues) UDEV  [13781.908021] remove  
> /devices/pci:00/:00:13.2/usb4/4-4/4-4:1.0/net/usb1 (net) UDEV 
> [13781.908429] remove   /devices/pci:00/:00:13.2/usb4/4-4/4-4:1.0
> (usb) UDEV  [13781.919474] remove  
> /devices/pci:00/:00:13.2/usb4/4-4 (usb) KERNEL[13781.993142]
> remove  
> /devices/pci:00/:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/rx-0
> (queues) KERNEL[13781.993182] remove  
> /devices/pci:00/:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/tx-0
> (queues) KERNEL[13781.993211] remove  
> /devices/pci:00/:00:13.2/usb4/4-5/4-5:1.0/net/usb0 (net) UDEV 
> [13781.993928] remove  
> /devices/pci:00/:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/rx-0
> (queues) UDEV  [13781.994215] remove  
> /devices/pci:00/:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/tx-0
> (queues) KERNEL[13781.998111] remove  
> /devices/pci:00/:00:13.2/usb4/4-5/4-5:1.0 (usb)
> KERNEL[13781.998170] remove   /devices/pci:00/:00:13.2/usb4/4-5
> (usb) UDEV  [13782.000177] remove  
> /devices/pci:00/:00:13.2/usb4/4-5/4-5:1.0/net/usb0 (net) UDEV 
> [13782.000767] remove   /devices/pci:00/:00:13.2/usb4/4-5/4-5:1.0
> (usb) UDEV  [13782.013093] remove  
> /devices/pci:00/:00:13.2/usb4/4-5 (usb)
> 
> 
> This is printed, when I connect the first Arietta to the PC:
> 
> monitor will print the received events for:
> UDEV - the event which udev sends out after rule processing
> KERNEL - the kernel uevent
> 
> KERNEL[14000.140611] add  /devices/pci:00/:00:13.2/usb4/4-5
> (usb) KERNEL[14000.141572] add 
> /devices/pci:00/:00:13.2/usb4/4-5/4-5:1.0 (usb)
> KERNEL[14000.141967] add 
> /devices/pci:00/:00:13.2/usb4/4-5/4-5:1.0/net/usb0 (net)
> KERNEL[14000.142000] add 
> /devices/pci:00/:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/rx-0
> (queues) KERNEL[14000.142046] add 
> /devices/pci:00/:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/tx-0
> (queues) UDEV  [14000.162311] add 
> /devices/pci:00/:00:13.2/usb4/4-5 (usb) UDEV  [14000.163727] add  
>/devices/pci:00/:00:13.2/usb4/4-5/4-5:1.0 (usb) UDEV 
> [14000.170206] add 
> /devices/pci:00/:00:13.2/usb4/4-5/4-5:1.0/net/usb0 (net) UDEV 
> [14000.170572] add 
> /devices/pci:00/:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/rx-0
> (queues) UDEV  [14000.185482] add 
> /devices/pci:00/:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/tx-0
> (queues
> 
> 
> This is printed, when I connect the second Arietta to the PC:
> 
> monitor will print the received events for:
> UDEV - the event which udev sends out after rule processing
> KERNEL - the kernel uevent
> 
> KERNEL[14108.192714] add  /devices/pci:00/:00:13.2/usb4/4-4
> (usb) KERNEL[14108.193781] add 
> /devices/pci:00/:00:13.2/usb4/4-4/4-4:1.0 (usb)
> KERNEL[14108.194211] add 
> /devices/pci:00/:00:13.2/usb4/4-4/4-4:1.0/net/usb1 (net)
> KERNEL[14108.194247] add 
> /devices/pci:00/:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/rx-0
> (queues) KERNEL[14108.194269] add 
> /devices/pci:00/:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/tx-0
> (queues) UDEV  [14108.211967] add 
> /devices/pci:00/:00:13.2/usb4/4-4 (usb) UDEV  [14108.213327] add  
>/devices/pci:00/:00:13.2/usb4/4-4/4-4:1.0 (usb) UDEV 
> [14108.217344] add 
> /devices/pci:00/:00:13.2/usb4/4-4/4-4:1.0/net/usb1 (net) UDEV 
> [14108.217615] add 
> /devices/pci:00/:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/rx-0
> (queues) UDEV  [14108.237237] add 
> /devices/pci:00/:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/tx-0
> (queues)
> 
> 
> The assigment to certain USB ports may vary from time to time.
> 
> 
> This is what lsusb prints for both devices
> 
> 
> Bus 004 Device 007: ID 0525:a4a2 Netchip Technology, Inc. Linux-USB
> Ethernet/RNDIS Gadget Device Descriptor:
>   bLength1

Re: [gentoo-user] Net problems

2015-05-13 Thread Meino . Cramer
Mick  [15-05-14 08:00]:
> On Thursday 14 May 2015 04:45:38 meino.cra...@gmx.de wrote:
> > Hi,
> > 
> > I have a problem with some kind of a lokal net connection (ethernet
> > over USB):
> 
> I think that the problem is not network related, but USB rules related.  
> Please see below.
> 
> 
> > Current handling is as follows:
> > I boot my Gentoo-Linux PC, which connects to my Fritz!Box, collect
> > EMail etc...works fine so far.
> > Then I connect an embedded system (Arietta G25
> > www.acmesystems.it/arietta) to the usb port and wait until this
> > little thing has booted.
> > On my Linux PC I do the following then (as root):
> > 
> > ifconfig usb0 192.168.10.1 up
> > echo 1 >! /proc/sys/net/ipv4/ip_forward
> > iptables -A FORWARD -i eth1 -j ACCEPT
> > modprobe ip_tables
> > modprobe ip_conntrack
> > iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
> > ssh -t root@ariettaa abduco -A root
> > 
> > (I real life I have two Ariettas which I connect to the
> > PC the same time with two different IP-addresses and two
> > different USB-ports)
> > 
> > This connects me finally to the Arietta, which do ethernet over USB.
> > I put the commands into a script, so not too much hassle here.
> > 
> > But!
> > On the Arietta I also installed Gentoo. An update, especially
> > when it includes gcc can take up to three days (I tried
> > crosscompilation and some other construction and I am currently
> > most happiest (sounds a litte too much like 'german english'...;)
> > with this).
> > So I first fetch all needed files and then restart the update
> > and detach from the terminal.
> > 
> > Now the problem:
> > When I shutdown the PC, which needs not to run all the time, and
> > restart it later again I am no longer able to connect to the Arietta
> > with the steps described above. All needed modules are loaded while
> > booting the PC and ifplugd is installed on the Arietta.
> > 
> > Unfortunately I have not found any differences of the USB interface,
> > which would make it possible to handle the Ariettas via udev.
> 
> Have you used 'udevadm monitor' to check how your USB device is recognised?  
> Each time it will be a different host & target and this is your problem.
>  
> 
> > How can I make a reconnect after rebooting my PC possible every time?
> 
> I think that the solution is to create a udev rule which will identify your 
> arietta interface when plugged in the PC and run the necessary script from 
> there on.
> 
> Have a look here for persistent device naming:
> 
> https://wiki.gentoo.org/wiki/Udev
> 
> -- 
> Regards,
> Mick

Hi Mick,

This is what udevadm monitor prints, when I unplug both Ariettas 
simultanously:
solfire:/home/mccramer>udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[13781.884965] remove   
/devices/pci:00/:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/rx-0 (queues)
KERNEL[13781.885027] remove   
/devices/pci:00/:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/tx-0 (queues)
KERNEL[13781.885067] remove   
/devices/pci:00/:00:13.2/usb4/4-4/4-4:1.0/net/usb1 (net)
UDEV  [13781.886418] remove   
/devices/pci:00/:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/rx-0 (queues)
KERNEL[13781.889122] remove   /devices/pci:00/:00:13.2/usb4/4-4/4-4:1.0 
(usb)
KERNEL[13781.889194] remove   /devices/pci:00/:00:13.2/usb4/4-4 (usb)
UDEV  [13781.902185] remove   
/devices/pci:00/:00:13.2/usb4/4-4/4-4:1.0/net/usb1/queues/tx-0 (queues)
UDEV  [13781.908021] remove   
/devices/pci:00/:00:13.2/usb4/4-4/4-4:1.0/net/usb1 (net)
UDEV  [13781.908429] remove   /devices/pci:00/:00:13.2/usb4/4-4/4-4:1.0 
(usb)
UDEV  [13781.919474] remove   /devices/pci:00/:00:13.2/usb4/4-4 (usb)
KERNEL[13781.993142] remove   
/devices/pci:00/:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/rx-0 (queues)
KERNEL[13781.993182] remove   
/devices/pci:00/:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/tx-0 (queues)
KERNEL[13781.993211] remove   
/devices/pci:00/:00:13.2/usb4/4-5/4-5:1.0/net/usb0 (net)
UDEV  [13781.993928] remove   
/devices/pci:00/:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/rx-0 (queues)
UDEV  [13781.994215] remove   
/devices/pci:00/:00:13.2/usb4/4-5/4-5:1.0/net/usb0/queues/tx-0 (queues)
KERNEL[13781.998111] remove   /devices/pci:00/:00:13.2/usb4/4-5/4-5:1.0 
(usb)
KERNEL[13781.998170] remove   /devices/pci:00/:00:13.2/usb4/4-5 (usb)
UDEV  [13782.000177] remove   
/devices/pci:00/:00:13.2/usb4/4-5/4-5:1.0/net/usb0 (net)
UDEV  [13782.000767] remove   /devices/pci:00/:00:13.2/usb4/4-5/4-5:1.0 
(usb)
UDEV  [13782.013093] remove   /devices/pci:00/:00:13.2/usb4/4-5 (usb)


This is printed, when I connect the first Arietta to the PC:

monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[14000.140611] add  /devices/

Re: [gentoo-user] Net problems

2015-05-13 Thread Mick
On Thursday 14 May 2015 04:45:38 meino.cra...@gmx.de wrote:
> Hi,
> 
> I have a problem with some kind of a lokal net connection (ethernet
> over USB):

I think that the problem is not network related, but USB rules related.  
Please see below.


> Current handling is as follows:
> I boot my Gentoo-Linux PC, which connects to my Fritz!Box, collect
> EMail etc...works fine so far.
> Then I connect an embedded system (Arietta G25
> www.acmesystems.it/arietta) to the usb port and wait until this
> little thing has booted.
> On my Linux PC I do the following then (as root):
> 
> ifconfig usb0 192.168.10.1 up
> echo 1 >! /proc/sys/net/ipv4/ip_forward
> iptables -A FORWARD -i eth1 -j ACCEPT
> modprobe ip_tables
> modprobe ip_conntrack
> iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
> ssh -t root@ariettaa abduco -A root
> 
> (I real life I have two Ariettas which I connect to the
> PC the same time with two different IP-addresses and two
> different USB-ports)
> 
> This connects me finally to the Arietta, which do ethernet over USB.
> I put the commands into a script, so not too much hassle here.
> 
> But!
> On the Arietta I also installed Gentoo. An update, especially
> when it includes gcc can take up to three days (I tried
> crosscompilation and some other construction and I am currently
> most happiest (sounds a litte too much like 'german english'...;)
> with this).
> So I first fetch all needed files and then restart the update
> and detach from the terminal.
> 
> Now the problem:
> When I shutdown the PC, which needs not to run all the time, and
> restart it later again I am no longer able to connect to the Arietta
> with the steps described above. All needed modules are loaded while
> booting the PC and ifplugd is installed on the Arietta.
> 
> Unfortunately I have not found any differences of the USB interface,
> which would make it possible to handle the Ariettas via udev.

Have you used 'udevadm monitor' to check how your USB device is recognised?  
Each time it will be a different host & target and this is your problem.
 

> How can I make a reconnect after rebooting my PC possible every time?

I think that the solution is to create a udev rule which will identify your 
arietta interface when plugged in the PC and run the necessary script from 
there on.

Have a look here for persistent device naming:

https://wiki.gentoo.org/wiki/Udev

-- 
Regards,
Mick


signature.asc
Description: This is a digitally signed message part.