1
Hardware and Performance / Re: Intel XMM 7360 LTE mPCIe modem support
« on: July 31, 2023, 02:05:44 am »
In fact Fibocom L860-GL is compatible with the FreeBSD.
Moreover it is one of the LTE modems that can work over a high speed CDC-NCM interface (using cdce(4) driver) so you would not be limited to 115200 baud rate and all that old PPP stuff like mpd5.
You'll be able to achieve speeds up to the USB port bandwidth you'll connect it to (if your ISP will provide you with a such bandwidth).
Since there are still no QMI or MBIM drivers available in the current FreeBSD and OPNSense distributions, this modem is one of the few that can allow to achieve a high bandwidth over the modern LTE networks.
Fibocom L860-GL expose several devices over USB interface to the FreeBSD host.
There are three USB Serial ports (CDC-ACM devices), usually named /dev/cuaU0, /dev/cuaU1 and /dev/cuaU2.
The /dev/cuaU0 is a PPP modem and an AT command port.
The /dev/cuaU1 is a debug port, so we shouldn't try to send any commands to it.
And the /dev/cuaU2 is another AT command port.
So you can use /dev/cuaU0 or /dev/cuaU2 to send AT commands to this modem, but it is recommended to use the /dev/cuaU2 if you plan to run it in a CDC-NCM mode.
There are also three USB Network adapters (CDC-NCM devices) usually named /dev/ue0, /dev/ue1 and /dev/ue2.
They are all equal, so you can use any of them to route network traffic.
So here are the simple steps to bring up that modem and a CDC-NCM network interface under FreeBSD installation, but they should be also appliable to an OPNSense.
Let's assume that we'll use /dev/cuaU2 to send AT commands to the modem and /dev/ue0 as a network interface to send our network traffic.
The following commands should be run from the command prompt so you'll need a direct or SSH connection to the box.
First we'll need to connect to the Serial port with the cu utility using 115200 baud rate to issue some AT commands:
Then we can test if the modem is receiving (and replying to) our commands, using standard ATI command:
After that we should check if the modem has received an APN configuration from the LTE operator.
Fibocom L860-GL has an "Auto connect" feature enabled by default and the most of the LTE operators now are pushing their APN information automatically. So we should send the following command and check it's output:
We'll receive something simillar to the following line in reply:
If there is no IP address in the output of this command is being displayed or it is all zeroes then some additional
configuration steps are required but it's a part of another post =).
There could be several lines displayed in a reply to that command, since this modem supports up to 30 PDP's concurrently.
Next we should check if that PDP is active or if we have several PDP's configured, we need to know wich one is currently active. We'll use the following command to check for an active PDP configuration:
We'll use this PDP ID later on, so take a note of it.
Now we need to setup a routing inside the modem from that PDP to a CDC-NCM device.
We'll use the following command for that purpose:
We'll receive the simple
Now we need to enable data transfer from the PDP (and the LTE network) to our NCM device.
So we'll send the following command to the modem:
Here we'll also get just
If the "connect flag" option in the AT+XDATACHANNEL command was set to "2" we'll also get the
Now we've got our modem configured and connected to the LTE network.
But we need some additional information to setup our /dev/ue0 network interface.
We should issue the following command to get that information from the modem:
The response will be similar to the following line:
Take a note of all theese addresses since we'll need them to configure our ue0 network interface and routing.
Now we can quit the cu session using
First of all we should take a note of the MAC address that was assigned by the OS to the ue0 interface.
We can issue an
Check the "ether" parameter in the ifconfig output.
Most of the time the ue0 interface will be assigned with the "00:00:11:12:13:14" MAC address.
Now we can assign an IP address to the ue0 interface:
Next we need to add a static route to the gateway address:
And a static ARP entry for the gateway:
For the name resolution to work we should add the DNS addresses to the /etc/resolv.conf file by manually editing it or using OPNSense GUI. Use DNS addresses that were obtained from the AT+CGCONTRDP command output earlier.
And at last we can switch a default gateway from the currently assigned one to the LTE operator gateway obtained from the AT+CGCONTRDP command.
Use
or use OPNSense GUI for that, where "10.108.216.31" is a gateway address we've got from the AT+CGCONTRDP command earlier.
Moreover it is one of the LTE modems that can work over a high speed CDC-NCM interface (using cdce(4) driver) so you would not be limited to 115200 baud rate and all that old PPP stuff like mpd5.
You'll be able to achieve speeds up to the USB port bandwidth you'll connect it to (if your ISP will provide you with a such bandwidth).
Since there are still no QMI or MBIM drivers available in the current FreeBSD and OPNSense distributions, this modem is one of the few that can allow to achieve a high bandwidth over the modern LTE networks.
Fibocom L860-GL expose several devices over USB interface to the FreeBSD host.
There are three USB Serial ports (CDC-ACM devices), usually named /dev/cuaU0, /dev/cuaU1 and /dev/cuaU2.
The /dev/cuaU0 is a PPP modem and an AT command port.
The /dev/cuaU1 is a debug port, so we shouldn't try to send any commands to it.
And the /dev/cuaU2 is another AT command port.
So you can use /dev/cuaU0 or /dev/cuaU2 to send AT commands to this modem, but it is recommended to use the /dev/cuaU2 if you plan to run it in a CDC-NCM mode.
There are also three USB Network adapters (CDC-NCM devices) usually named /dev/ue0, /dev/ue1 and /dev/ue2.
They are all equal, so you can use any of them to route network traffic.
So here are the simple steps to bring up that modem and a CDC-NCM network interface under FreeBSD installation, but they should be also appliable to an OPNSense.
Let's assume that we'll use /dev/cuaU2 to send AT commands to the modem and /dev/ue0 as a network interface to send our network traffic.
The following commands should be run from the command prompt so you'll need a direct or SSH connection to the box.
First we'll need to connect to the Serial port with the cu utility using 115200 baud rate to issue some AT commands:
Code: [Select]
cu -s 115200 -l /dev/cuaU2
and we should receiveCode: [Select]
Connected
as a reply.Then we can test if the modem is receiving (and replying to) our commands, using standard ATI command:
Code: [Select]
ATI
And we'll receive something simillar to this in reply:Code: [Select]
".Built@May 29 2020:10:45:41"
After that we should check if the modem has received an APN configuration from the LTE operator.
Fibocom L860-GL has an "Auto connect" feature enabled by default and the most of the LTE operators now are pushing their APN information automatically. So we should send the following command and check it's output:
Code: [Select]
AT+CGDCONT?
This command will list all the PDP (Protocol Data Point) configured in the modem.We'll receive something simillar to the following line in reply:
Code: [Select]
+CGDCONT: 0,"IP","internet","10.108.216.30",0,0,0,0,0,0,0,0,0,0
Take a note that there is a PDP with an ID "0" exist and an IP address "10.108.216.30" is being assigned by an LTE operator to our modem and an APN called "internet" is being used. If there is no IP address in the output of this command is being displayed or it is all zeroes then some additional
configuration steps are required but it's a part of another post =).
There could be several lines displayed in a reply to that command, since this modem supports up to 30 PDP's concurrently.
Next we should check if that PDP is active or if we have several PDP's configured, we need to know wich one is currently active. We'll use the following command to check for an active PDP configuration:
Code: [Select]
AT+CGACT?
And we'll receive something similar to the following line:Code: [Select]
+CGACT: 0,1
The output of this command will list the PDP number and a state of that PDP separated by comma. Where "1" means that PDP is in active state and "0" means that it inactive. So in this example we've got a PDP with ID "0" active and configured.We'll use this PDP ID later on, so take a note of it.
Now we need to setup a routing inside the modem from that PDP to a CDC-NCM device.
We'll use the following command for that purpose:
Code: [Select]
AT+XDATACHANNEL=1,1,"/USBCDC/2","/USBHS/NCM/0",1,0
Where the first parameter is the routing mode (set to "1" to enable routing), the second one is the channel type (set to "1" for GPRS/LTE), the third one is the name of our command interface (set to "/USBCDC/2" for /dev/cuaU2), the fourth one is the name of the modem NCM device (set to "/USBHS/NCM/0" for /dev/ue0), the fifth one is the connect flag (you should set it to "1" or "2"), and the sixth one is the PDP ID (it is set to "0" in our case since we've got PDP with ID "0" configured and active).We'll receive the simple
Code: [Select]
OK
in reply to this command.Now we need to enable data transfer from the PDP (and the LTE network) to our NCM device.
So we'll send the following command to the modem:
Code: [Select]
AT+CGDATA=M-RAW_IP,0
where "M-RAW_IP" is a layer 2 protocol type (should always be set to "M-RAW_IP") and "0" is our PDP ID.Here we'll also get just
Code: [Select]
OK
in reply if everything went fine.If the "connect flag" option in the AT+XDATACHANNEL command was set to "2" we'll also get the
Code: [Select]
CONNECT
message from the modem.Now we've got our modem configured and connected to the LTE network.
But we need some additional information to setup our /dev/ue0 network interface.
We should issue the following command to get that information from the modem:
Code: [Select]
AT+CGCONTRDP=0
where "0" is our PDP ID number.The response will be similar to the following line:
Code: [Select]
+CGCONTRDP:0,5,"internet","10.108.216.30.255.0.0.0","10.108.216.31","10.205.171.68","10.205.171.77","","",0,,0,,0
where the "10.108.216.30.255.0.0.0" is an interface IP address and a network mask (dot separated), "10.108.216.31" is a gateway address, and "10.205.171.68","10.205.171.77" are the DNS server addresses.Take a note of all theese addresses since we'll need them to configure our ue0 network interface and routing.
Now we can quit the cu session using
Code: [Select]
~.
command or open another terminal or SSH connection to our FreeBSD or OPNSense box and configure network interface settings.First of all we should take a note of the MAC address that was assigned by the OS to the ue0 interface.
We can issue an
Code: [Select]
ifconfig -a
command and look for the ue0 interface and it's MAC address.Check the "ether" parameter in the ifconfig output.
Most of the time the ue0 interface will be assigned with the "00:00:11:12:13:14" MAC address.
Now we can assign an IP address to the ue0 interface:
Code: [Select]
ifconfig ue0 10.108.216.30/32 -arp
Where "10.108.216.30" is an IP address we've got from the AT+CGCONTRDP command earlier.Next we need to add a static route to the gateway address:
Code: [Select]
route add 10.108.216.31 -interface ue0
Where "10.108.216.31" is a gateway address we've got from the AT+CGCONTRDP command earlier.And a static ARP entry for the gateway:
Code: [Select]
arp -s 10.108.216.31 00:00:11:12:13:14
Where "10.108.216.31" is a gateway address we've got from the AT+CGCONTRDP command earlier and "00:00:11:12:13:14" is a MAC address of the ue0 interface.For the name resolution to work we should add the DNS addresses to the /etc/resolv.conf file by manually editing it or using OPNSense GUI. Use DNS addresses that were obtained from the AT+CGCONTRDP command output earlier.
And at last we can switch a default gateway from the currently assigned one to the LTE operator gateway obtained from the AT+CGCONTRDP command.
Use
Code: [Select]
route add default 10.108.216.31
command if there were no default gateway assigned orCode: [Select]
route change default 10.108.216.31
if there was a default gateway definedor use OPNSense GUI for that, where "10.108.216.31" is a gateway address we've got from the AT+CGCONTRDP command earlier.