[LEDE-DEV] [PATCH] netifd-proto.sh: add ip4table & ip6table to `proto_add_dynamic_defaults()`

Alexandru Ardelean ardeleanalex at gmail.com
Sun Sep 10 01:02:16 PDT 2017


On Sat, Sep 9, 2017 at 10:51 PM, Baptiste Jonglez
<baptiste at bitsofnetworks.org> wrote:
> On 09-09-17, Baptiste Jonglez wrote:
>> On 05-09-17, Alexandru Ardelean wrote:
>> > The `proto_add_dynamic_defaults()` seems to be called mostly
>> > in the context of LTE/3G modems (via wwan, qmi, etc) setup.
>> >
>> > When they get setup, these devices override default routes.
>> >
>> > However, depending on setup, we want these modems to
>> > be part of a another routing table.
>> > This change allows that.
>> >
>> > ip4table/ip6table are of string type in netifd to allow
>> > for `default`, `local` routing table names to be specified.
>>
>> Just a remark on the names: "ip4table" and "ip6table" make it looks like
>> it's related to firewall.  But this has nothing to do with firewalls.
>>
>> Maybe use "routingtable" and "routingtablev6" instead?  Or just
>> "table"/"tablev6"?
>
> It seems that "ip4table" and "ip6table" is already understood by other
> protocols, so you can disregard my remark:
>
> https://wiki.openwrt.org/doc/uci/network#options_valid_for_all_protocol_types

This got into my spam folder for some reason.
GMail is weird sometimes.

I still have to try this out a bit more.
I'm load-balancing various stuff, so I did not get to try out stuff in depth.

Atm I'm doing:
config interface 'usb0_1'
     option ifname 'usb0'
     option proto 'wwan'
     option ip4table 100
     option ip6table 100

This seems to make an interface [in netifd] called
network.interface.usb0_1  which adds the ip4table/ip6table to usb0.
However, for some reason [likely a bug with my config generation code]
the DHCP part is not initializing properly ; well for some reason no
RX packets are incoming.
I'll dig into that.

My trip through getting LTE setup on our system was a bit interesting.
At some point, I've found that the modem needs a backport from the
upstream kernel.
For the 4.4 kernel, this is needed for some QMI modems:
https://github.com/torvalds/linux/commit/93725149794d3d418cf1eddcae60c7b536c5faa1

Otherwise, the modem does not init. That patch should be in 4.5 though.


>
>
>> > Signed-off-by: Alexandru Ardelean <ardeleanalex at gmail.com>
>> > ---
>> >  scripts/netifd-proto.sh | 2 ++
>> >  1 file changed, 2 insertions(+)
>> >
>> > diff --git a/scripts/netifd-proto.sh b/scripts/netifd-proto.sh
>> > index cc7031a..fd7b596 100644
>> > --- a/scripts/netifd-proto.sh
>> > +++ b/scripts/netifd-proto.sh
>> > @@ -26,6 +26,8 @@ proto_add_dynamic_defaults() {
>> >     [ -n "$defaultroute" ] && json_add_boolean defaultroute "$defaultroute"
>> >     [ -n "$peerdns" ] && json_add_boolean peerdns "$peerdns"
>> >     [ -n "$metric" ] && json_add_int metric "$metric"
>> > +   [ -n "$ip4table" ] && json_add_string ip4table "$ip4table"
>> > +   [ -n "$ip6table" ] && json_add_string ip6table "$ip6table"
>> >  }
>> >
>> >  _proto_do_teardown() {
>
>



More information about the Lede-dev mailing list