The ultimate goal is to set up a cheapest home Internet with a T-Mobile tablet plan. One side of a non-OpenWrt router is connected to a T-Mobile 5G gateway and the other side is connected to a Raspberry Pi for bypassing T-Mobile's data throttling. The non-OpenWrt router is for better wifi broadcasting.
Tested firmware version: Raspberry Pi 4B 64bit Version 21.02.3. Firewall rules not working. When I ping 8.8.8.8 in terminal, it should have TTL=68, but instead I get a random number. Tried other versions of OpenWrt official firmware but none worked. I guess it's a network parameter setting issue or something missing from the official firmware. At the same time, I tested the customized firmware provided by others and found that I could ping TTL=68. However, the firmware contained a large number of software packages, such as ad blocking, VPN, NAS, etc., which I did not need. My only purpose was to succeed in running the firewall rules and successfully modify the TTL. I really appreciate if you could provide a less bloated firmware or solutions to the original firmware.
Correct reply after ping 8.8.8.8 in the terminal:
Firewall rules mentioned above:
# iptables rules for mangling ipv4 and ipv6 traffic
# prerouting rules appear to prevent leaks to the ISP
iptables -t mangle -I PREROUTING 1 -j TTL --ttl-set 68
ip6tables -t mangle -I PREROUTING 1 -j HL --hl-set 68
# postrouting rules do the heavy lifting
iptables -t mangle -I POSTROUTING 1 -j TTL --ttl-set 68
ip6tables -t mangle -A POSTROUTING 1 -j HL --hl-set 68
# modem decrements TTL from 65 to 64, which is what the ISP sees :)
Workable Firmware:
- Glinet MT3000: OpenWrt 21.02-SNAPSHOT r15812+879-46b6ee7ffc / LuCI openwrt-
21.02 branch git-22.245.77575-63bfee6 - OpenWrt R24.01.18 by Haiibo / LuCI Master (git-24.014.66729-f45ed56)
Unworkable Firmware Version: (downloaded at https://firmware-selector.openwrt.org)
- Raspberry Pi 4B 64bit Version 21.02.3. (r16554-1d4dea6d4f) FACTORY (EXT4).
OpenWrt 21.02.3 firmware Network Settings:
vi /etc/config/network
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth0'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option netmask '255.255.255.0'
option ipaddr '192.168.12.2'
option gateway '192.168.12.1'
list dns '192.168.12.1'
vi /etc/config/firewall
config defaults
option syn_flood 1
option input ACCEPT
option output ACCEPT
option forward REJECT
# Uncomment this line to disable ipv6 rules
# option disable_ipv6 1
config zone
option name lan
list network 'lan'
option input ACCEPT
option output ACCEPT
option forward ACCEPT
config zone
option name wan
list network 'wan'
list network 'wan6'
option input REJECT
option output ACCEPT
option forward REJECT
option masq 1
vi /etc/config/wireless
config wifi-device 'radio0'
option type 'mac80211'
option path 'platform/soc/fe300000.mmcnr/mmc_host/mmc1/mmc1:0001/mmc1:00
option channel '36'
option band '5g'
option htmode 'VHT80'
option disabled '1'
config wifi-iface 'default_radio0'
option device 'radio0'
option network 'lan'
option mode 'ap'
option ssid 'OpenWrt'
option encryption 'none'
vi /etc/config/dhcp
config dnsmasq
option domainneeded '1'
option boguspriv '1'
option filterwin2k '0'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
option nonegcache '0'
option authoritative '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
option nonwildcard '1'
option localservice '1'
option ednspacket_max '1232'
config dhcp 'lan'
option interface 'lan'
option start '100'