OpenWRT, ModemManager, Sierra EM7455, IP passthrough

Jack Broderick jbroderick at councilrock.com
Tue Dec 7 14:38:26 UTC 2021


Hello,

We have also done something like this via scripting. Here is an outline of
how the scripts work. The main idea is the wwan interface comes up and then
you reassign that IP and setup firewall/DHCP configurations. There may need
to be some changes but this should be a good place  to start.

# Remove the IP addresses from the interface
ip a flush dev <wwan interface>
ip link set dev <wwan interface> mtu <MTU from LTE network>

ip link set <wwan interface> up
ip link set <lan interface> up
ip route add default dev <wwan interface> table 42
ip route add default dev <lan interface> table 43
ip rule add pref 5042 iif <lan interface> lookup 42
ip rule add pref 5043 iif <wwan interface> lookup 43

# Configure proxy arp
echo 1 >/proc/sys/net/ipv4/conf/<wwan interface>/proxy_arp

You then need to configure dhcp such that lan with assign one IP to the the
client:
cat > /tmp/conf <<- EOM
option domain-name-servers ${dns1}${dns2};
shared-network <lan interface> {
subnet 0.0.0.0 netmask 0.0.0.0 {
range <address from LTE network> <address from LTE network>;
option subnet-mask 255.255.255.254;
option routers <gateway from LTE network>;
default-lease-time 43200;
max-lease-time 43200;
}
}
EOM

Start using dhcpd
dhcpd -q -pf /var/run/test.pid -cf /tmp/conf -lf /tmp/lease <LAN Interface>

# Assign an IP address to the lan network (I've found it doesn't really
matter what it is which is kind of interesting.
ip a add <LAN IP> dev <lan interface>

# The final step is to create firewall rules between the lan and the wan
interface so forwarding is allowed

Hope this helps!
Jack

On Tue, Dec 7, 2021 at 9:27 AM Peter Naulls <peter at chocky.org> wrote:

> On 12/4/21 1:31 PM, James Thomas wrote:
> > Evening all,
> >
> > I’ve been racking my brains trying to figure out how I might, in
> OpenWRT, get
> > modemmanager and netifd to ‘passthrough’ the IP assigned in the bearer
> when
> > making an mbim connection to a client connecting to eth1.
> >
> > My aim, as I’m sure is apparent, is to make OpenWRT transparent to the
> device
> > connected to eth1 whilst granting that device access to the data
> connection made
> > through modemmanager, OpenWRT and the Sierra EM7455 card.
> >
>
> Good luck. We do passthrough in out solution, but it was a a lot of work,
> and I
> don't think it would be entirely appropriate to reveal all the details
> (some
> pieces are proprietary anyway).
>
> What I can say is that ModemManager as it stands, isn't up to it - the
> OpenWrt
> setup needs a new protocol for this type of connection. To that end, we
> don't
> presently use ModemManager in this case; I did start work on such a
> protocol,
> but without fixing up all the other pieces, it's of limited use. Maybe it's
> something I can contribute one day.
>
> Also, this would be a bridging setup, vs the default NAT setup in OpenWrt,
> but I think that's pretty obvious.
>
> Regards.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/modemmanager-devel/attachments/20211207/f6a05295/attachment-0001.htm>


More information about the ModemManager-devel mailing list