Opened 9 years ago

Closed 8 years ago

Last modified 6 years ago

#405 closed bug (fixed)

WAN static IP lost after using 3G connection

Reported by: mihaly.reg@… Owned by:
Priority: high Milestone: Firmware
Component: fon-network Version: (Gari)
Severity: unknown
Cc: xfreebird@… Hardware: both


F2G RC1. Static IP configured on WAN. Then 3G modem is connected, WAN disconnected, reboot F2. 3G is working. But if plugging out 3G and connecting the WAN cable the Static IP setting is replaced by DHCP. Selecting manually again the Static IP, the settings are not lost.

Attachments (0)

Change History (10)

comment:1 Changed 9 years ago by matthijs

  • Component changed from fon-base-firmware to fon-network
  • Hardware set to 2.0g (FON2202)
  • Milestone Firmware 2.3.0rc1 deleted
  • Status changed from new to investigate
  • Version set to Other

comment:2 Changed 9 years ago by matthijs

  • Cc xfreebird@… added
  • Hardware changed from 2.0g (FON2202) to both
  • Summary changed from WAN cable Static IP lost after using 3G connection to WAN static IP lost after using 3G connection
  • Version changed from Other to (Gari)

#627 is a duplicate of this bug and is reported for

comment:3 Changed 9 years ago by matthijs

  • Priority changed from normal to major

comment:4 Changed 9 years ago by matthijs

This seems to be caused by the following code in /etc/fonststated/UMTS:

    os.execute("killall umtsd.lua")
    uci_state:revert("umtsd", "umtsdstate")
    if umts == "umts" then
        uci:set("fon", "wan", "mode", "dhcp")

This resets the fon/wan/mode variable to "dhcp" after killing umtsd.lua.

comment:5 Changed 9 years ago by matthijs

  • Milestone set to Firmware
  • Severity set to unknown

comment:6 Changed 8 years ago by matthijs

  • Status changed from investigate to confirmed

I implemented a fix for this, which I'll commit in the near future.

comment:7 Changed 8 years ago by matthijs

(In [1909]) umtsd: Fix a race condition when unplugging a 3G modem.

Before, when a 3G modem is unplugged, a hotplug script would unset umtsd.umtsd.attached and then call the UMTS fonstated script. The latter would check the attached variable and kill umtsd if it was not set. However, umtsd would periodically rewrite the umtsd state config. Everytime it does so, it also rewrites umtsd.umtsd.attached=1. If this rewriting happened between the resetting of the attached variable in the hotplug script and its reading in the UMTS script, umtsd would not be properly terminated, even though the 3G modem was unplugged.

It seems this race condition was more often triggered with a (still uncommited) fix for #405 in place (for reasons I do not understand).

To fix this, a bunch of code has been moved from the UMTS script to the hotplug script. Now, the hotplug script takes care of most of the stuff UMTS used to do: Killing umtsd.lua (re)setting the wan mode, resetting the umtsd config. UMTS is still used to restart umtsd on configuration changes (since the networking code also kills umtsd when appropriate).

References: #405

comment:8 Changed 8 years ago by matthijs

  • Resolution set to fixed
  • Status changed from confirmed to closed

(In [1910]) umtsd: Restore the old internet config after unplugging a 3g modem.

Before, the internet configuration would always be changed to "dhcp", even when it was something else like bridge or static before plugging in the mode. Now, the old mode is saved and restored after unplugging (and on boot, in case the mode is still set to umts from a previous boot).

Closes: #405

comment:9 Changed 8 years ago by matthijs

(In [1911]) umtsd: When (re)starting or stopping umtsd, restart all networking.

This is needed to support switching from and to bridge mode, which requires changing the LAN and thus wifi configurations as well. For good measure, also reconfigure OpenVPN. There is no need to restart DDNS, that is handled through iface hotplug scripts.

References: #405

comment:10 Changed 8 years ago by matthijs

(In [1912]) umtsd: Empty resolv.conf after unplugging a 3g modem.

This ensures that the dns servers from the 3g connection don't linger around. This wasn't previously a problem, since the Fonera always switched back to dhcp mode, which overwrites the resolv.conf file.

References: #405

Add Comment

Modify Ticket

as closed The ticket will remain with no owner.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.