The default TTL value on the 4G router is 64. In some conditions, we need to change the TTL value to 65. The TTL parameter is controlled by /etc/sysctl.conf. We can edit the “sysctl.conf” file via SSH terminal or WinSCP software.
After connected to the 4G router, access the router admin. Go to “System > Terminal” to access the SSH interface on the web page. We can also use PuTTY software to access the SSH interface.
Input the below command and press enter to check the current TTL value. If the return value includes “TTL=64”, follow the below steps to change the TTL value.
ping -c 3 localhost
Step 1 - Edit TTL on sysctl.conf
- Use the below command to open the configure file.
- Find a free line, and hit “Insert” on the keyboard to edit the configure file.
Note: On a Mac computer, use Fn+i or Fn+Command+Return to insert a new line.
- Add the below content on the free line.
- Hit “ESC” on the keyboard to stop editing
- Input “:wq” to save the configuration file and quit the VI editor.
- Reboot the router
- Use the above “ping -c 3 localhost” command to verify the TTL value.
Step 2 - Add Custom Firewall Rule
After logging into the router’s admin panel.
Navigate to “Network > Firewall.”
Click the “Custom Rules” tab.
Add the below scripts to the end of the input box.
iptables -t mangle -I POSTROUTING -o wwan0 -j TTL --ttl-set 65
Other TTL Values
In some oscillations, the TTL value needs to use the other value, such as 128.
To set the TTL value to 128, replace 65 with 128 on the above step 1 and 2.