Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue writing MAC #15

Open
nigelpatsmith opened this issue Mar 12, 2022 · 2 comments
Open

Issue writing MAC #15

nigelpatsmith opened this issue Mar 12, 2022 · 2 comments

Comments

@nigelpatsmith
Copy link

nigelpatsmith commented Mar 12, 2022

I've been having issues getting UFiber.Configurator to write the MAC address.

➜  macos-x64 ./UFiber.Configurator --host 192.168.1.1 --vendor ARLT --serial ######## --mac 30:B1:xx:xx:xx:xx
### Original Image ###
--- NVRAM Information --
- mtdblock3 hash: 759ca19c79dc00c54a75c36e73959b101679de020704cac8aaefc84e0e1802a8
- NVRAM Version: 6
- Boot parameters: e=192.168.1.1:ffffff00 h=192.168.1.254 g= r=f f=vmlinux i=bcm963xx_fs_kernel d=1 p=0 c= a=
- Board Id: UBNT_SFU_####
- PSI size: 24
- Total MAC addresses: 5
- GPON MAC address: D0:21:xx:xx:xx:xx
- GPON Vendor Id: UBNT
- GPON Serial Number: ########
- GPON SLID (password):
- Checksum: 447620156

### Patching fw-11032022-110808.bin...
Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.ArgumentException: Data must be an even length. (Parameter 'data')
   at UFiber.Configurator.NVRAM.AsBytes(String data)
   at UFiber.Configurator.NVRAM.SetBaseMacAddress(String mac)
   at <Program>$.<>c.<<Main>$>b__0_2(String host, String user, String pw, Int32 port, Boolean dryRun, String slid, String vendor, String serial, String mac, String fwToRestore)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Delegate.DynamicInvoke(Object[] args)
   at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass23_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass27_0.<<UseVersionOption>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass25_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__24_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass11_0.<<UseDebugDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__10_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<<UseExceptionHandler>b__0>d.MoveNext()

When I use it just to write the serial, theres no problem.

➜  macos-x64 ./UFiber.Configurator --host 192.168.1.1 --vendor ARLT --serial ########
### Original Image ###
--- NVRAM Information --
- mtdblock3 hash: 759ca19c79dc00c54a75c36e73959b101679de020704cac8aaefc84e0e1802a8
- NVRAM Version: 6
- Boot parameters: e=192.168.1.1:ffffff00 h=192.168.1.254 g= r=f f=vmlinux i=bcm963xx_fs_kernel d=1 p=0 c= a=
- Board Id: UBNT_SFU_####
- PSI size: 24
- Total MAC addresses: 5
- GPON MAC address: D0:21:xx:xx:xx:xx
- GPON Vendor Id: UBNT
- GPON Serial Number: ########
- GPON SLID (password):
- Checksum: 447620156

### Patching fw-11032022-110936.bin...
### Patched fw-11032022-110936.bin!
--- NVRAM Information --
- mtdblock3 hash: b39e55e5dcaf42fe3d2ed0c5d0cf91bd90b33b347b3656aa2389eff328b39ec4
- NVRAM Version: 6
- Boot parameters: e=192.168.1.1:ffffff00 h=192.168.1.254 g= r=f f=vmlinux i=bcm963xx_fs_kernel d=1 p=0 c= a=
- Board Id: UBNT_SFU_6848
- PSI size: 24
- Total MAC addresses: 5
- GPON MAC address: D0:21:F9:15:68:80
- GPON Vendor Id: ARLT
- GPON Serial Number: 10347795
- GPON SLID (password):
- Checksum: 3432620010

Uploading patched file to the target UFiber device...
Uploaded!
### Applying patched file on the target UFiber device...
### Applied patch! Please reboot your UFiber device to load the new image.

I was finally able to get the MAC changed as a third step using usb_serial_hack.py

➜  Downloads ./ubi_serial_hack.py -r 192.168.1.1 -p 22 --serial 41:52:4c:54:xx:xx:xx:xx --mac 30:B1:xx:xx:xx:xx --insecure
Password:
[+] Downloaded mtdblock3.BIN
[!] Hashsum of mtdblock3.BIN (sha256): 094553cd45b34658c442d803456130097ba0eef79a8bcb1e66624f7724ef0283
[~] nvram_version:    6
[~] boot_line:        "e=192.168.1.1:ffffff00 h=192.168.1.254 g= r=f f=vmlinux i=bcm963xx_fs_kernel d=1 p=0 c= a= "
[~] board_id:         "UBNT_SFU_####"
[~] main_thread:      0
[~] psi_size:         24
[~] num_mac_addr:     5
[~] base_mac_addr:    d0:21:xx:xx:xx:xx
[~] old_check_sum:    0xffffffff
[~] vendor_id:        "UBNT"
[~] serial_id:        "f9156880"
[~] serial_formatted: "55:42:4e:54:xx:xx:xx:xx"
[~] gpon_password:    "          "
[~] checksum:         0xddaa45a
[+] Built mtdblock3_new.BIN
[!] Hashsum of mtdblock3_new.BIN (sha256): eaa4666b5f1dfad8a6a233e01dcfd7067c95ea4b2ad09542b2f47eebe4722ad2
[~] nvram_version:    6
[~] boot_line:        "e=192.168.1.1:ffffff00 h=192.168.1.254 g= r=f f=vmlinux i=bcm963xx_fs_kernel d=1 p=0 c= a= "
[~] board_id:         "UBNT_SFU_xxxx"
[~] main_thread:      0
[~] psi_size:         24
[~] num_mac_addr:     5
[~] base_mac_addr:    30:b1:xx:xx:xx:xx
[~] old_check_sum:    0xffffffff
[~] vendor_id:        "ARLT"
[~] serial_id:        "xxxxxxxx"
[~] serial_formatted: "41:52:4c:54:xx:xx:xx:xx"
[~] gpon_password:    "          "
[~] checksum:         0xfd2b0d9b
[+] Uploaded mtdblock3_new.BIN
@hmmferreira
Copy link

I hope I am not saying something wrong, but I just went through the same process and removing the colons from the MAC address solved the issue for me.

Instead of passing the mac as --mac 30:B1:xx:xx:xx:xx, try --mac 30B1xxxxxxxx

I hope this helps.

@nigelpatsmith
Copy link
Author

nigelpatsmith commented Mar 15, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants