Setting a mostly sane default value there has been perfectly fine for the last 3 versions of fwknop included with Openwrt. I understand that this default value will not always be correct. That said, fwknop *always* requires modifications to the config files. To set up the ports and set the password, one has to modify the config files.
I would like to eventually build a uci based config for fwknop and a luci module. Until then, it remains the flat config file. And just like a desktop install, we've put a sane default in the config file. And just like a desktop install, if it's wrong, the user can change it. The routers I use default to eth1. If the consensus is that eth1 is not a sane default, I can drop the config patch altogether. It will default to eth0, which makes sense for most desktops. In that case, the same idea applies: the user can change it if needed. I'm not willing to put a kludge in the firstboot scripts, or even worse, a wrapper script that tries to figure out if it's been run before, and detects and writes to the config. The last thing we need is a config file that thinks it's smarter than the user. So RFC here. Should I retain the patch that sets the capture port to eth1 or drop the patch and let it default to eth0? Or is there a good way to detect the wan port and write it to the config, but only on firstboot? On Fri, Aug 2, 2013 at 8:34 AM, Bastian Bittorf <[email protected]>wrote: > * Jonathan Bennett <[email protected]> [02.08.2013 15:22]: > > > +# The following line is changed specifically for Openwrt. > > > +# Openwrt defaults to using eth1 as its wan port. If using PPPoE, > > > +# Then this needs to be set to pppoe-wan. > > > + > > > +PCAP_INTF eth1; > > nobody will commit this. > there is no easy way to detect > > a) > is there any wan port? > > b) > which wan (if there is more than one) you want to use > > you can "guess" your wan during first run via something like. > > get_wandev() > { > local wandev > > # e.g. > # 0.0.0.0 10.63.76.1 0.0.0.0 UG 2 0 0 wlan0-1 > > set -- $( route -n | grep ^'0\.0\.0\.0' | head -n1 ) > while [ -n "$1" ]; do wandev="$1"; shift; done # lastword > > echo "wandev" > } > > but this is not 100% - any other suggestions? > > best would be to write a wrapper, which takes uci-vars and builds a > correct config for you program out of this. > > bye, bastian > _______________________________________________ > openwrt-devel mailing list > [email protected] > https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel >
_______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
