Subject: [homenet] upstream dhcp with hnetd

From: Tim Coote <[email-masked]>
Date: Thu, 15 Sep 2016 11:45:59 +0100

Hullo

Still trying to get homenet working :-(

I’m using hnet-full on CC 15.05.1 on Linksys wrt1200ac.
My ISP requires dhcpv4 parameters to establish a connection, both clientid and vendorid.

http://www.homewrt.org/about/faq <http://www.homewrt.org/about/faq> shows how to set clientid by inserting it into (runtime) /lib/netifd/proto/hnet.sh. However, the context in the file does not seem to be present ("Between json_add_string name “${interface}_4” and json_close_object for IPv4”): neither ${interface_4}, nor json_close_object. There is no equivalent instruction for vendorid.

Additionally, this is an ADSL connection so I need a pppoe connection to my external modem, including a username/password. What’s the canonical way to add this extra step with hnetd?  I can add it to a uci interface (even an interface not called WAN) and the connection is made, but I don’t know whether this will interfere with hnet. 

I have no idea whether it’s related, but hnetd segfaults soon after starting - and I cannot find a core file. I can restart hnetd, spot the command running, and run that command manually with —loglevel 9 at the end. It ends thus:

hnetd[2736]: Router B0A0B130
hnetd[2736]: hncp_run /usr/sbin/hnetd-routing
hnetd[2736]:  bfsipv6prefix
hnetd[2736]:  fd55:dfae:42ce::/48
hnetd[2735]: Executing PA Routine for no-prefix%excluded-prefixes from fd55:dfae:42ce::/48 flags (- - -)
hnetd[2736]:  
hnetd[2735]: No matching rule was found.
hnetd[2735]: platform: *** begin interface update inhnet (wlan0)
hnetd[2735]: 	Elected(SMPHL): 0, Zone: lan
hnetd[2735]: platform: *** end interface update inhnet (wlan0)
hnetd[2735]: platform: *** begin interface update e06 (eth0)
hnetd[2735]: 	Elected(SMPHL): 0, Zone: wan
hnetd[2735]: platform: *** end interface update e06 (eth0)
hnetd[2735]: platform: async notify_proto for inhnet: Success
hnetd[2735]: platform: async notify_proto for e06: Success
Segmentation fault

‘inhnet’ is my internal homenet controlled interface (just wlan0). ‘e06’ is the hnet controlled interface on eth0. I’m also running pppoe on eth0 to establish the ISP connection, so I can imagine that these two are tripping over each other.

I’d rather not go through the pain of building from source and adding debug statements, but, if necessary, I will.

Tim

---

From: Massimiliano Stucchi <[email-masked]>
Date: Sun, 18 Sep 2016 19:20:34 +0200

Hi,

> I’m using hnet-full on CC 15.05.1 on Linksys wrt1200ac.

I would suggest moving to head.  I spent an inordinate amount of time
trying to debug issues I was having with 15.05.1, and then found out
that upgrading to head made the network more robust.

> Additionally, this is an ADSL connection so I need a pppoe connection to
> my external modem, including a username/password. What’s the canonical
> way to add this extra step with hnetd?  I can add it to a uci interface
> (even an interface not called WAN) and the connection is made, but I
> don’t know whether this will interfere with hnet. 

I have a similar situation, although on a fiber connection that requires
PPPoE for IPv4.  I solved it like this:

config interface 'homenet4'
	option ifname 'eth0.6'
	option proto 'pppoe'
	option username 'username'
	option password 'password'

config interface 'homenet4ext'
	option ifname 'pppoe-homenet4'
	option proto 'hnet'
	option mode 'external'
	option _orig_ifname 'pppoe-homenet4'

Basically, you "piggyback" on the interface created by PPPoE to use it
for hnet.

> I’d rather not go through the pain of building from source and adding
> debug statements, but, if necessary, I will.

Again, I suggest moving to head.  You'll find more mature code.

Ciao!

-- 

Massimiliano Stucchi
MS16801-RIPE

---

From: Rich Brown <[email-masked]>
Date: Sun, 18 Sep 2016 21:12:31 -0400

Hi Massimiliano,

I'll happily update the "Installing Homenet..." guide if you could give me a few hints about installing a head version of Homenet on OpenWrt 15.05.1. - http://www.homewrt.org/installation/hnet-openwrt I will also test the procedure before posting, so I know that it worked at least once. :-)

Thanks,

Rich

> On Sep 18, 2016, at 1:20 PM, Massimiliano Stucchi <[email-masked]> wrote:
> 
> 
> Hi,
> 
> _______________________________________________
> homenet mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/homenet

---

From: Tim Coote <[email-masked]>
Date: Mon, 19 Sep 2016 09:20:32 +0100

> On 18 Sep 2016, at 18:20, Massimiliano Stucchi <[email-masked]> wrote:
> 
Thanks for that assurance. Is HEAD always stable enough to at least avoid bricking the router? I note that there’s also some enthusiasm for LEDE, but I don’t think that all installs of homenet work.

> Basically, you "piggyback" on the interface created by PPPoE to use it
That’s pretty much where I got to for pppoe, although I wasn’t (still amn’t?) confident that I understand what ‘interface’ does within OpenWRT, especially if/how it stacks up use of different ifname’s within /etc/config/network and /etc/config/wireless. I have noticed that WAN/LAN and WAN6 have special meanings: WAN6 is not aware of all protocols, for instance. There are also oddities such as WAN_6 which seem to appear.  I believe that the _orig_ifname is an artifact of Luci. But I could be wrong.
> Again, I suggest moving to head.  You'll find more mature code.
Ok. And clearly hnetd in particular will have moved on.

Any insight into how I can get the hnetd use of dhcp to send the clientid and vendor class identifiers (options 61 and 60) as these are used by my isp to establish the connection? I think that they also have some timing constraints relative to dhcpv6 exchange.

Tim

---

From: Tim Coote <[email-masked]>
Date: Fri, 23 Sep 2016 10:44:00 +0100

> My ISP requires dhcpv4 parameters to establish a connection, both clientid and vendorid.

Following up this question, I stumbled across this thread from 2015: http://bit.ly/2cLUZrV <http://bit.ly/2cLUZrV>, in which, Steven Barth <cyrus at openwrt.org> noted:

“Additional note:

Do NOT run DHCP or DHCPv6 manually (either server or client) on interfaces you run hnet on as this will cause confusion or worse. hnet takes care of anything DHCP(v6).”

So I do need to find a way to set those dhcpv4 parameters (options 60 and 61) using hnetd.

Is it possible?
Tim