9front - general discussion about 9front
 help / color / mirror / Atom feed
* DHCP not working on usb ethernet dongle
@ 2016-12-29 21:19 Dave MacFarlane
  2016-12-29 22:23 ` [9front] " sl
  2016-12-29 22:37 ` cinap_lenrek
  0 siblings, 2 replies; 11+ messages in thread
From: Dave MacFarlane @ 2016-12-29 21:19 UTC (permalink / raw)
  To: 9front

I finally got a USB dongle for my laptop with a supported chipset
(ASIX AX88178), but when I try running ip/ipconfig it tells me that it
had no luck with DHCP. (The dongle *is* showing up under
/net/etherUwhatever, and cat'ing the addr file gives me the MAC
address, so it's finding the dongle, it's just not configuring/using
it). Any pointers on how I can get more verbose information about why
it's failing or what to look into?

(I tried manually configuring it with "ip/ipconfig -g <gateway> ether
add <an ip address> 255.255.255.0", but it doesn't seem to work that
way either, at least not well enough to ip/ping 8.8.8.8..)

- Dave


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9front] DHCP not working on usb ethernet dongle
  2016-12-29 21:19 DHCP not working on usb ethernet dongle Dave MacFarlane
@ 2016-12-29 22:23 ` sl
  2016-12-29 22:31   ` Dave MacFarlane
  2016-12-29 22:37 ` cinap_lenrek
  1 sibling, 1 reply; 11+ messages in thread
From: sl @ 2016-12-29 22:23 UTC (permalink / raw)
  To: 9front

Does the DHCP server definitely work?

Does it (need to) know your dongle's MAC address?

Etc.

sl


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9front] DHCP not working on usb ethernet dongle
  2016-12-29 22:23 ` [9front] " sl
@ 2016-12-29 22:31   ` Dave MacFarlane
  0 siblings, 0 replies; 11+ messages in thread
From: Dave MacFarlane @ 2016-12-29 22:31 UTC (permalink / raw)
  To: 9front

Yes. The same dongle with the same cable plugged into the same port on
the same router with the same laptop works with DHCP when booted into
DragonflyBSD.

On Thu, Dec 29, 2016 at 5:23 PM,  <sl@stanleylieber.com> wrote:
> Does the DHCP server definitely work?
>
> Does it (need to) know your dongle's MAC address?
>
> Etc.
>
> sl



-- 
- Dave


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9front] DHCP not working on usb ethernet dongle
  2016-12-29 21:19 DHCP not working on usb ethernet dongle Dave MacFarlane
  2016-12-29 22:23 ` [9front] " sl
@ 2016-12-29 22:37 ` cinap_lenrek
  2016-12-30  1:02   ` driusan
  1 sibling, 1 reply; 11+ messages in thread
From: cinap_lenrek @ 2016-12-29 22:37 UTC (permalink / raw)
  To: 9front

have you actually passed the usb ethernet interface to ipconfig? when
you leave the interface out ipcofig will just use the first ethernet
it finds on /net. it might have just configured your built in ethernet.

you do that like:

ip/ipconfig ether /net/etherUwhatever

if that doesnt work, start troubleshooting systematically:

figure out if usb ethernet works at all, run snoopy /net/etherUwhatever
and look if you see broadcast packets on the network. setup static
ip for that, so you can ping your host or send out pings and see if
both directions work.

--
cinap


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9front] DHCP not working on usb ethernet dongle
  2016-12-29 22:37 ` cinap_lenrek
@ 2016-12-30  1:02   ` driusan
  2016-12-30  4:13     ` cinap_lenrek
  0 siblings, 1 reply; 11+ messages in thread
From: driusan @ 2016-12-30  1:02 UTC (permalink / raw)
  To: cinap_lenrek@felloff.net, 9front


‎There is no built in ethernet, but I just tried explicitly passing it and still no luck. It looks like it's sending out packets, but not reading any responses back.

When I watch the traffic with snoopy, and I try to get a lease it sends out a bunch of packets of the form:

ether(s=<mac addr> d=ffffffffffff pr=0800 ln=590)
Ip(s=0.0.0.0 d=255.255.255.255 id=n frag=0000 ttl=255 pr=17 ln=576)
udp(s=68 d=67 ck=a3a3 ln= 556)
bootp(t=Req ht=1 hl=6 hp=0 xid=75d7f49b sec=n fl=0000 ca=0.0.0.0 ya=0.0.0.0 sa=0.0.0.0 ga=0.0.0.0 cha=<mac addr> magic=63825363)
dhcp(t=Discover clientid=01<mac addr> vendorclass=plan9_386 requested=(1 3 6 12 15 42))

But as far as I can see, gets no response.

When I manually configure it and ping the gateway I get packets sent that look like:
ether(s=<mac> d=fffffffff pr=0806 ln=60)
arp(‎op=1 len=4/6 spa=<manual ip> sha=<mac addr> tpa=<gateway ip> tha=000000)

When I ping my own manual IP, I'm getting icmp(t=EchoReq) and EchoRep lines that aren't in the output of pinging the gateway. (For the‎ manual ip address, I'm using the IP that the router has associated with the MAC address from when I tested it under Dfly.)

I'm not really sure where to go from here.
  Original Message  
From: cinap_lenrek@felloff.net
Sent: jeudi 29 décembre 2016 17:37
To: 9front@9front.org
Reply To: 9front@9front.org
Subject: Re: [9front] DHCP not working on usb ethernet dongle

have you actually passed the usb ethernet interface to ipconfig? when
you leave the interface out ipcofig will just use the first ethernet
it finds on /net. it might have just configured your built in ethernet.
‎
you do that like:

ip/ipconfig ether /net/etherUwhatever

if that doesnt work, start troubleshooting systematically:

figure out if usb ethernet works at all, run snoopy /net/etherUwhatever
and look if you see broadcast packets on the network. setup static
ip for that, so you can ping your host or send out pings and see if
both directions work.

--
cinap


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9front] DHCP not working on usb ethernet dongle
  2016-12-30  1:02   ` driusan
@ 2016-12-30  4:13     ` cinap_lenrek
  2016-12-31  1:49       ` Dave MacFarlane
  0 siblings, 1 reply; 11+ messages in thread
From: cinap_lenrek @ 2016-12-30  4:13 UTC (permalink / raw)
  To: 9front

> There is no built in ethernet, but I just tried explicitly passing it and still
> no luck. It looks like it's sending out packets, but not reading any responses back.

check on the other side if it is really sending packets. snoopy sees the
packets that go out because the kernel just loops back what gets send on
the interface. but that doesnt mean these packets actually hit the wire.

otherwise it looks like the driver isnt working, so you'd have to debug
the driver.

0) figure out what device this is, cat /dev/usb/ctl...

1) run ps aux and find the nusb/ether processed and notice the program
arguments if any. we need the -t parameter and the device id.

2) unbind the ip interface and kill the nusb/ether processes

3) locate the driver for your specific type in /sys/src/cmd/nusb/ether
and add debug prints. you can then rebuild and start a fresh driver
process with the program arguments from (1).

4) look up the dragonflybsd driver from the info from (0) and see if
we need todo some special magic to get that device working.

--
cinap


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9front] DHCP not working on usb ethernet dongle
  2016-12-30  4:13     ` cinap_lenrek
@ 2016-12-31  1:49       ` Dave MacFarlane
  2017-01-02  3:21         ` cinap_lenrek
  2017-01-02  3:35         ` mveety
  0 siblings, 2 replies; 11+ messages in thread
From: Dave MacFarlane @ 2016-12-31  1:49 UTC (permalink / raw)
  To: cinap_lenrek@felloff.net

I'm not certain that it's hitting the wire, but I don't have any
techniques more advanced than looking for blinking lights on the
router or dongle while running ip/ipconfig either.

Is there anything special I need to do to unbind the usb device? I'm
unbinding the ip interface with 'ip/ipconfig ether /net/etherwhatever
unbind', and then killing nusb/ether with 'slay ether | rc', but when
I try and restart nusb/ether I'm getting an error "nusb/ether: sharefd
usbnet: '#<symbol I don't know how to type on a Mac>c/usbnet/3.ether'
already exists", where 3. matches the usb bus from step 0.

I'm a little suspicious that it's not using the right driver, because
when I run ps -aux there's no arguments displayed, but I think it
should have at least "-t a88178". /rc/bin/nusbrc says nusb/ether is
handled by /sys/src/9/boot/nusbrc, and the vendor/device id from
/dev/usb/ctl are the first one in the case statement for that type
there. But I can't manually run it with the right arguments either,
because of the above error.


On Thu, Dec 29, 2016 at 11:13 PM,  <cinap_lenrek@felloff.net> wrote:
>> There is no built in ethernet, but I just tried explicitly passing it and still
>> no luck. It looks like it's sending out packets, but not reading any responses back.
>
> check on the other side if it is really sending packets. snoopy sees the
> packets that go out because the kernel just loops back what gets send on
> the interface. but that doesnt mean these packets actually hit the wire.
>
> otherwise it looks like the driver isnt working, so you'd have to debug
> the driver.
>
> 0) figure out what device this is, cat /dev/usb/ctl...
>
> 1) run ps aux and find the nusb/ether processed and notice the program
> arguments if any. we need the -t parameter and the device id.
>
> 2) unbind the ip interface and kill the nusb/ether processes
>
> 3) locate the driver for your specific type in /sys/src/cmd/nusb/ether
> and add debug prints. you can then rebuild and start a fresh driver
> process with the program arguments from (1).
>
> 4) look up the dragonflybsd driver from the info from (0) and see if
> we need todo some special magic to get that device working.
>
> --
> cinap



-- 
- Dave


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9front] DHCP not working on usb ethernet dongle
  2016-12-31  1:49       ` Dave MacFarlane
@ 2017-01-02  3:21         ` cinap_lenrek
  2017-01-04 23:20           ` Steve Simon
  2017-01-02  3:35         ` mveety
  1 sibling, 1 reply; 11+ messages in thread
From: cinap_lenrek @ 2017-01-02  3:21 UTC (permalink / raw)
  To: 9front

> I try and restart nusb/ether I'm getting an error "nusb/ether: sharefd
> usbnet: '#<symbol I don't know how to type on a Mac>c/usbnet/3.ether'
> already exists", where 3. matches the usb bus from step 0.

ah, yes. i forgot that. just remove that file:

rm '#σc'/usbnet/ether*

--
cinap


^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [9front] DHCP not working on usb ethernet dongle
  2016-12-31  1:49       ` Dave MacFarlane
  2017-01-02  3:21         ` cinap_lenrek
@ 2017-01-02  3:35         ` mveety
  1 sibling, 0 replies; 11+ messages in thread
From: mveety @ 2017-01-02  3:35 UTC (permalink / raw)
  To: 9front

[-- Attachment #1: Type: text/plain, Size: 202 bytes --]

If you need more debugging support you can pop another machine in between the 9front machine and the rest of the network, the take a look at what’s coming out of the machine-under-test.

--
Veety

[-- Attachment #2: Type: text/html, Size: 1451 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9front] DHCP not working on usb ethernet dongle
  2017-01-02  3:21         ` cinap_lenrek
@ 2017-01-04 23:20           ` Steve Simon
  2017-01-05 14:06             ` Dave MacFarlane
  0 siblings, 1 reply; 11+ messages in thread
From: Steve Simon @ 2017-01-04 23:20 UTC (permalink / raw)
  To: 9front, 9fans

Its not the same problem, but just in case it helps,
adding a second usb ether adapter onto a raspberry pi,
which runs the labs distro not 9front.

I need to add 
	ether1=type=usb
to cmdline.txt

and then add the following to /cfg/$sysname/termrc

	if(! ~ `{cat '#l1/ether1/addr'} 000000000000){
		echo ether1: present 
		bind -b '#l1' /net.alt
		bind -b '#I1' /net.alt
		ip/ipconfig -x /net.alt ether /net.alt/ether1
		ndb/cs -x /net.alt
		ndb/dns -x /net.alt -r
	}
	if not {
		echo ether1: missing
	}

this worked seamlessly once I got a supported, and reliable ethernet dongle.
I tried a couple of chinese ones but settled on an apple one which is well
manufactured (perhaps I was just unlucky).

All kudos to Richard Miller who helped me through this.

-Steve


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9front] DHCP not working on usb ethernet dongle
  2017-01-04 23:20           ` Steve Simon
@ 2017-01-05 14:06             ` Dave MacFarlane
  0 siblings, 0 replies; 11+ messages in thread
From: Dave MacFarlane @ 2017-01-05 14:06 UTC (permalink / raw)
  To: 9front mailing list; +Cc: Fans of the OS Plan 9 from Bell Labs

I don't think it's related, since there's no primary ethernet or /net
on the laptop for it to conflict with (there's just a wifi card that
isn't supported, which is why I needed the dongle in the first place.)

I spent some time comparing nusb/ether/asix.c to the axeg(4) driver on
my lunch hour yesterday, and I'm suspecting that it might be a 88178
vs 88178a chipset thing since the rx ctl register is different between
the two drivers and the problem is that asixreceive() is never getting
called, but I haven't had a chance to dig any deeper or verify if it's
an "a" chipset with mislabeled packaging while I have physical access
to the machine/dongle.

On Wed, Jan 4, 2017 at 6:20 PM, Steve Simon <steve@quintile.net> wrote:
> Its not the same problem, but just in case it helps,
> adding a second usb ether adapter onto a raspberry pi,
> which runs the labs distro not 9front.
>
> I need to add
>         ether1=type=usb
> to cmdline.txt
>
> and then add the following to /cfg/$sysname/termrc
>
>         if(! ~ `{cat '#l1/ether1/addr'} 000000000000){
>                 echo ether1: present
>                 bind -b '#l1' /net.alt
>                 bind -b '#I1' /net.alt
>                 ip/ipconfig -x /net.alt ether /net.alt/ether1
>                 ndb/cs -x /net.alt
>                 ndb/dns -x /net.alt -r
>         }
>         if not {
>                 echo ether1: missing
>         }
>
> this worked seamlessly once I got a supported, and reliable ethernet dongle.
> I tried a couple of chinese ones but settled on an apple one which is well
> manufactured (perhaps I was just unlucky).
>
> All kudos to Richard Miller who helped me through this.
>
> -Steve



-- 
- Dave


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-01-05 14:06 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-29 21:19 DHCP not working on usb ethernet dongle Dave MacFarlane
2016-12-29 22:23 ` [9front] " sl
2016-12-29 22:31   ` Dave MacFarlane
2016-12-29 22:37 ` cinap_lenrek
2016-12-30  1:02   ` driusan
2016-12-30  4:13     ` cinap_lenrek
2016-12-31  1:49       ` Dave MacFarlane
2017-01-02  3:21         ` cinap_lenrek
2017-01-04 23:20           ` Steve Simon
2017-01-05 14:06             ` Dave MacFarlane
2017-01-02  3:35         ` mveety

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).