Skip to content

Commit

Permalink
install: remove feature to change to overrideslot to avoid bricking
Browse files Browse the repository at this point in the history
Fixes #6
  • Loading branch information
rssor committed Feb 13, 2024
1 parent d519fd4 commit e7296e6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 22 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# FS.com XGS-ONU-25-20NI AT&T Modification Utility
This utility makes the necessary changes to the FS.com XGS-PON ONU to allow it to operate on AT&T (USA), Orange (FR), and other XGS-PON fiber offerings. It attempts to do so as safely as possible, reverting automatically to a stock state if it is ever power cycled twice in quick succession.

This particular FS.com device is actually a CIG XG-99S which is available under a variety of different brands. There is an entire family of devices running very similar firmwares that can likely also be modified in roughly the same way, though modifications to this utility would be required to support them. Of particular interest are the CIG XG-99M devices (best known as the FOX-222) which can be found for $30-$50 online as of writing and which I plan to look at in the near future.
# FS.com XGS-ONU-25-20NI / CIG XG-99S Modification Utility
This utility makes the necessary changes to CIG XG-99S devices to allow them to operate on AT&T (USA), Orange (FR), KPN (NL), Telus (CA), Frontier (USA) and other XGS-PON fiber offerings. It attempts to do so as safely as possible, reverting automatically to a stock state if it is ever power cycled twice in quick succession.

While this modification attempts to be as safe _as possible_ it's much less safe than running an unmodified device. Although the device has two firmware slots they share the userdata partition that gets mounted to `/mnt/rwdir/`. During boot all CIG firmwares check for `/mnt/rwdir/setup.sh` and run it if it exists. This is done before the PON stack starts, so if anything goes wrong *it will never come online* and you will need UART access and micro-soldering skills to recover the device. For this reason, the modification disarms itself as the first action it takes during every boot -- that is the _only_ safety mechanism available.

Expand Down Expand Up @@ -45,6 +43,8 @@ By convention the documentation below uses `GPON227000fe` to refer to the serial

Ensure that you're sitting adjacent to the stick on the network and that you have an address in the `192.168.100.0/24` subnet. The stick is at `192.168.100.1`. Ensure that your machine is configured to accept conncections on port `8172` (you may need to add a firewall allow rule for this!). Activating the mod for a single boot only requires one command:

NOTE: Certain ISPs can skip full installation and use only the [`overrideslot`](#override-eth-uni-slot) command.

```
# ATT
./fs_xgspon_mod.py install GPON227000fe att HUMA12ab34cd
Expand All @@ -55,9 +55,7 @@ Ensure that you're sitting adjacent to the stick on the network and that you hav
# Telus
./fs_xgspon_mod.py install GPON227000fe telus ARCB12ab34cd
# KPN, just changing the ethernet uni slot from 10 to 1 and keeping the rest as-is
# you can register the serial number of the module through the self-service tool of your provider
./fs_xgspon_mod.py install GPON227000fe kpn
# KPN should not use this command, but overrideslot instead

This comment has been minimized.

Copy link
@arpiecodes

arpiecodes Feb 13, 2024

Contributor

Would it be possible to add an example of the overrideslot command here? To indicate KPN will be requiring slot 1, so the user can copy paste the command from the readme (like the other ISP's) and apply directly?

# Any arbitrary ISP as long as you know the equipment id/hwver/swver and necessary ethernet uni slot
./fs_xgspon_mod.py install GPON227000fe manual ALCL12ab34cd --hwver SOMETHING --swver ELSE --eqvid EQUIPMENT --eth_slot 10
Expand Down Expand Up @@ -228,6 +226,8 @@ If you run `/s/m/show 506` from telnet and see 17 or fewer rules, you almost cer
- [YuukiJapanTech](https://github.com/YuukiJapanTech) - Assembling the spectacular resources at https://github.com/YuukiJapanTech/CA8271x/
- SipWannabe - Testing
- Mastah - Testing/Debugging Orange connectivity issues
- [Arpie](https://github.com/arpiecodes) - KPN support and `overrideslot`
- [up-n-atom](https://github.com/up-n-atom) - Telus support

## References
- https://github.com/YuukiJapanTech/CA8271x
Expand Down
31 changes: 16 additions & 15 deletions fs_xgspon_mod.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,6 @@ def __init__(self, args):

self.settings = []

if self.PREFER_SLOT_OVERRIDE is True:
print("[!] To make the ONU work on this ISP's network, just an ETH UNI slot override is needed")
print("[!] Performing a slot override does not require any dangerous payloads to be applied")
print("[!] However, you can also choose to go ahead and install the full modification")
print("[!] When in doubt, you should probably try the less invasive (o)verride option first")

answer = input("Choose either (o)verride or (i)nstall: ")

if "o" in answer:
return overrideslot(args)
elif not "i" in answer:
raise ValueError(f"invalid choice: expected either o or i")

if self.KEEP_SERIAL is True and args.isp_ont_serial is None:
# we prefer use the original serial, as there's no need to change it
self.serial = args.fs_onu_serial[4:].lower()
Expand Down Expand Up @@ -570,6 +557,18 @@ def install(args):
print(f"[-] {e}")
return

if settings.PREFER_SLOT_OVERRIDE is True:
print("[!] To make the ONU work on this ISP's network, just an ETH UNI slot override is needed")
print("[!] Performing a slot override does not require any dangerous payloads to be applied")
print("[!] However, you can also choose to go ahead and install the full modification")
print("[!] When in doubt, you should probably try the less invasive overrideslot command")

answer = input("Proceed with installation anyways? (y)es or (n)o").lower()

if answer not in ("y", "yes"):
print("[-] Aborting")
return

print("[+] Generated payload configuration:")

for line in settings.config.split("\n"):
Expand Down Expand Up @@ -704,6 +703,8 @@ def rearm(args):
print("[-] Telnet timeout reached... make sure it's reachable")

def overrideslot(args):
assert isinstance(args.eth_slot, int)

try:
with CigTelnet(args.onu_ip, args.fs_onu_serial) as tn:
print("[+] Telnet connection established, login successful")
Expand Down Expand Up @@ -817,7 +818,7 @@ def parse_vlan_filter(vf):
parse_install.add_argument("--eqvid", type=parse_length(20))
parse_install.add_argument("--hwver", type=parse_length(14))
parse_install.add_argument("--swver", type=parse_length(14))
parse_install.add_argument("--eth_slot", type=int, choices=(1, 10), metavar="[1,10]")
parse_install.add_argument("--eth_slot", type=int, choices=(1, 10))
parse_install.add_argument("--vlan_rules", type=parse_vlan_filter)
parse_install.set_defaults(func=install)

Expand All @@ -834,7 +835,7 @@ def parse_vlan_filter(vf):
parse_overrideslot = s.add_parser("overrideslot")
parse_overrideslot.add_argument("--onu_ip", default="192.168.100.1")
parse_overrideslot.add_argument("fs_onu_serial", type=parse_serial)
parse_overrideslot.add_argument("eth_slot", type=int, choices=(1, 10), metavar="[1,10]")
parse_overrideslot.add_argument("eth_slot", type=int, choices=(1, 10))
parse_overrideslot.set_defaults(func=overrideslot)

args = p.parse_args()
Expand Down

0 comments on commit e7296e6

Please sign in to comment.