Sample Header Ad - 728x90

Having trouble setting up data calling with rmnet_data0 interface

0 votes
1 answer
2781 views
I'm trying to set up a data call through rmnet_dataX interface which is referring to a cellular connection through the card inserted, but having trouble doing so. I do the following
ifconfig rmnet_data0 up
I then assign an IP statically
rmnet_data0 Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:10.246.68.132  Mask:255.0.0.0
          UP RUNNING  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
Add the default path in the routing table
ip ro add default via 10.246.68.132 dev rmnet_data0
Add the DNS server
echo "nameserver 8.8.4.4" >> /etc/resolv.conf
Set NAT rules
iptables -t nat -D POSTROUTING -o rmnet_data0 -j MASQUERADE
Routing table
netstat -r 

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface

default         10.246.68.132   0.0.0.0         UG        0 0          0 rmnet_data0
10.0.0.0        *               255.0.0.0       U         0 0          0 rmnet_data0
192.168.225.0   *               255.255.255.0   U         0 0          0 bridge0
ping google.com // fails
Also, the default path really just indicates the packets coming to the gateway IP are routed to the external network which in this case is network data? Given that, are NAT rules really required?
Asked by Jazzy (141 rep)
Mar 19, 2021, 05:18 AM
Last activity: Aug 12, 2025, 12:03 PM