89a7a956708e8df91939abf33f759aa1bb4f8d17
[oweals/nmrpflash.git] / README.md
1 nmrpflash - Netgear Unbrick Utility
2 ====================================
3
4 This program uses Netgear's [NMRP protocol]
5 (http://www.chubb.wattle.id.au/PeterChubb/nmrp.html)
6 to flash a new firmware image to a compatible device. This utility has been
7 tested with a Netgear EX2700, but is likely to work on many others as well.
8
9 Prebuilt binaries for Linux, OS X and Windows are available
10 [here](https://github.com/jclehner/nmrp-flash/releases).
11
12 ````
13 Usage: nmrpflash [OPTIONS...]
14
15 Options (-a, -i and -f are mandatory):
16  -a <ipaddr>     IP address to assign to target device
17  -f <firmware>   Firmware file
18  -i <interface>  Network interface directly connected to device
19  -m <mac>        MAC address of target device (xx:xx:xx:xx:xx:xx)
20  -M <netmask>    Subnet mask to assign to target device
21  -t <timeout>    Timeout (in milliseconds) for regular messages
22  -T <timeout>    Time to wait after successfull TFTP upload
23  -p <port>       Port to use for TFTP upload
24  -U              Test TFTP upload
25  -v              Be verbose
26  -V              Print version and exit
27  -L              List network interfaces
28  -h              Show this screen
29 ````
30
31 ### Using nmrpflash
32
33 Connect your Netgear router to your computer using a network cable.
34 Assign a static IP address to the network adapter that's plugged into
35 the Netgear router.
36
37 For this example, we'll assume that your network interface is `eth0`.
38 First, we have to assign a static IP address to our network interface.
39 In this example, we'll use `192.168.1.2`. All available network interfaces 
40 can be listed using
41
42 ````
43 $ nmrpflash -L
44 eth0      192.168.1.2  f2:11:a1:02:03:b1
45 ````
46
47 Now we can start `nmrpflash`. The argument for the `-a` option needs
48 to be a *free* IP address from the same subnet as the one used by your
49 network interface. We'll use `192.168.1.254`. The firmware image file
50 can usually be downloaded directly from Netgear's FTP servers.
51
52 ````
53 $ nmrpflash -i eth0 -a 192.168.1.254 -f EX2700-V1.0.1.8.img
54 Advertising NMRP server on eth0 ... /
55 Received configuration request from a4:2b:8c:00:00:01.
56 Sending configuration: ip 192.168.1.254, mask 255.255.255.0.
57 Uploading EX2700-V1.0.1.8.img ... OK
58 Waiting for remote to respond.
59 Remote finished. Closing connection.
60 ````
61
62 ### Common issues
63 ###### No suitable network interfaces found.
64
65 If you're *not* on Windows, rerun `nmrpflash -L` using `sudo`. In any case,
66 use `-vvvL` to see more detailed messages, and file a bug report if applicable.
67
68 ###### No response after 60 seconds. Bailing out.
69
70 The router did not respond. Try running `nmrpflash` with `-m` and specify
71 your router's MAC address. It's also entirely possible that your device does
72 not support the NMRP protocol.
73
74 ###### Timeout while waiting for 0x04.
75
76 After a successful file upload, `nmrpflash` waits for up to 60 seconds for an
77 answer from your device. You can increase this by specifying a longer timeout
78 using `-T` switch (argument is in milliseconds). 
79
80 It's entirely possible that the image was flashed successfully, but the
81 operation took longer than 60 seconds.
82
83 ### Building and installing
84 ###### Linux, Mac OS X, BSDs
85
86 ````
87 $ make && sudo make install
88 ````
89
90 ###### Windows
91
92 The repository includes a 
93 [DevCpp](http://sourceforge.net/projects/orwelldevcpp/)
94 project file (`nmrpflash.dev`). Download the latest 
95 [WinPcap Developer Pack](http://www.winpcap.org/devel.htm) 
96 and extract it into the root folder of the nmrpflash sources.
97