7/29/2019 Howto SAR715 Linux
1/16
Howto Upgrading firmware on SAR715 using Linux
Machasm..........
The method I used to upgrade my Sar715 ADSL modem router from solwise was to setup a DHCPserver running on my PC to issue an address to the router when booting from the Ethernet interface, in
combination with a tftp program to push the firmware to the router.
I thought I'd better write this for all us non-conformists out there :-)
Well, depending on your experience with Linux this might be very daunting or easy for you....It's based on Machasm guide and using RedHat 9.
Let us begin.
Things to have:
1. http://www.solwiseforum.co.uk/downloads/files/sar7x5sr2_1.21.zip2. http://ftp.redhat.com/pub/redhat/linux/9/en/os/i386/RedHat/RPMS/minicom-2.00.0-12.i386.rpm3. http://ftp.redhat.com/pub/redhat/linux/9/en/os/i386/RedHat/RPMS/dhcp-3.0pl1-23.i386.rpm4. http://ftp.redhat.com/pub/redhat/linux/9/en/os/i386/RedHat/RPMS/tftp-server-0.32-4.i386.rpm5. Serial cable.6. Hardware ethernet address of router. Something like: 00:30:EB:C6:49:EE
[Note 1: Install above rpms by typing, as root:rpm -Uvh *.rpm (if they are all in the samedirectory).
For firmware, type: unzip sar7x5sr2_1.21.zipthen type: mv ea715-3d3121-bootcode.bin boot.binand mv ea715-3d3121-030521a-tbc.bin flash.bin
Then type: mkdir /var/bootand finally, mv *.bin /var/bootchange directory to /var/boot andcheck they are there.]
Things to configure:
1. Minicom with serial cable connection2. Changing IP address3. DHCP Server4. TFTP Server5. Flashing
1. Minicom with serial cable connection:
Hook up the serial cable that came with the router
Howto Upgrading firmware on SAR715 using Linux 0.1 Gavin Henry 1
7/29/2019 Howto SAR715 Linux
2/16
Open a console. As root, (su then type your root password) Invoke minicom by:
[root@blackhat root]$ minicom
You should have a black screen. Press ctrl-a then z. The terminal should be:
1.1 Select o and then port settings. Set them up as follows:
Howto Upgrading firmware on SAR715 using Linux 0.1 Gavin Henry 2
7/29/2019 Howto SAR715 Linux
3/16
1.2 Then select modem and dialing settings. Set them as follows:
Howto Upgrading firmware on SAR715 using Linux 0.1 Gavin Henry 3
7/29/2019 Howto SAR715 Linux
4/16
1.3 Then save and exit.
Invoke it again as minicom -s and check that what you entered is still there. Then save as 'default'.
Howto Upgrading firmware on SAR715 using Linux 0.1 Gavin Henry 4
7/29/2019 Howto SAR715 Linux
5/16
1.4 Envoke as minicom default, then press enter.
Howto Upgrading firmware on SAR715 using Linux 0.1 Gavin Henry 5
7/29/2019 Howto SAR715 Linux
6/16
Success (overleaf)
Howto Upgrading firmware on SAR715 using Linux 0.1 Gavin Henry 6
7/29/2019 Howto SAR715 Linux
7/16
If there is something wrong, try doing it all again but invoking as $ minicom -s
2. Changing IP address
Keeping the console open with the admin prompt showing, open another console andsu - to root.type :
/sbin/ifconfig eth0 up 192.168.7.2 netmask 255.255.255.0(or leave out the /sbin/ bit ifyou typed su -)
check it worked by typing ifconfig again, which should show your new IP address.
3. DHCP Server
Now you should have already placed flash.bin and boot.bin in /var/boot, if not follow 'Note 1' on thefirst page to do so.
Make sure just the PC you are working on is connected to the router at this stage, through a network
cable and a serial cable.
Howto Upgrading firmware on SAR715 using Linux 0.1 Gavin Henry 7
7/29/2019 Howto SAR715 Linux
8/16
Open up a console again (use pico orvi), and type: pico -w /etc/dhcpd.confand make it looklike:
# Custom dhcpd configuration for 2 hostsddns-update-style ad-hoc;
default-lease-time 600;max-lease-time 7200;option broadcast-address 192.168.7.255;
subnet 192.168.7.0 netmask 255.255.255.0 {}
host router {hardware ethernet 00:30:EB:C6:49:EE;fixed-address 192.168.7.1;filename "flash.bin";server-name "laptop";
next-server 192.168.7.2;}
save by hitting ctrl-x and selecting Y (server-name can be anything)
[Note 2: you must make sure the hardware ethernet address is your one and not the one above. Itshould be on the bottom of the router]
Now type: touch /var/lib/dhcp/dhcp.leasesand service dhcpd restart
(You should get one failed and one ok).
To verify that the service is listening run:
netstat -an | grep 67
You should see a response that looks like:
udp 0 0 0.0.0.0:67 0.0.0.0:*
4. TFTP Server
If using INETD put the following line in your /etc/inetd.conf file:
tftp dgram udp wait root /usr/sbin/tcpd in.tftpd -c -u tftpd -s /var/boot
If using XINETD, /etc/xinetd.d/tftp should look like:
Howto Upgrading firmware on SAR715 using Linux 0.1 Gavin Henry 8
7/29/2019 Howto SAR715 Linux
9/16
# default: off# description: The tftp server serves files using the trivial file transfer \# protocol. The tftp protocol is often used to boot diskless \# workstations, download configuration files to network-aware printers, \# and to start the installation process for some operating systems.service tftp
{ socket_type = dgramprotocol = udpwait = yesuser = rootserver = /usr/sbin/in.tftpdserver_args = -c -u tftpd -s /var/bootdisable = no
}
Now type: useradd -d /dev/null -s /bin/nologin tftpd
and: chown -R tftpd /var/boot
now: service xinetd restart
To verify that the service is listening run:
netstat -an | grep 69
You should see a response that looks like:
udp 0 0 0.0.0.0:69 0.0.0.0:*
If you do not see this, double check your inetd.conf or xinetd tftpfile and then restart the service using above command.
5. Flashing
Let's run a check on what should have been done and what should be running:
1. You should have a serial cable connected to the router and minicom still running with the adminprompt still showing, and the router should still be switched off.
2. You should have a lan connection to the router, with no other pc connected (same pc used for serialcable and network cable)
3. You should have boot.bin and flash.bin in /var/boot4. You should have the dhcp server running5. You should have the tftp server running6. If not, go back to the other steps.
Howto Upgrading firmware on SAR715 using Linux 0.1 Gavin Henry 9
7/29/2019 Howto SAR715 Linux
10/16
Turn on the router and immediately hit * (Shift 8) in minicomconsole window to halt the bootprocess.
You should be presented with this window (taken form Machasm's guide0.
Type E to boot from Ethernet.You should see this (Note: you should see boot.bin)
Howto Upgrading firmware on SAR715 using Linux 0.1 Gavin Henry 10
7/29/2019 Howto SAR715 Linux
11/16
At this point the boot file is in the router but you must then save it!
In the minicom console type
Flashfs rewrite boot.bin
You should see this
Howto Upgrading firmware on SAR715 using Linux 0.1 Gavin Henry 11
7/29/2019 Howto SAR715 Linux
12/16
Next type flashfs updateyou should see this
Howto Upgrading firmware on SAR715 using Linux 0.1 Gavin Henry 12
7/29/2019 Howto SAR715 Linux
13/16
If you type restart the router should reboot and then return to this prompt if all has gone well.
Now that we have accomplished the first part we can now proceed to flashing the firmware code.In order to do this we simply change the boot file being sent by the DHCP server.
Change the file in the options of the DHCP server (/etc/dhcpd.conf) toflash.bin.
Dont forget to save it. Then type: service dhcpd restart
In yourminicomconsole type restart and immediately hit * (shift 8) and boot from Ethernet again
by choosing option E.
This time the firmware code should load as follows.
Howto Upgrading firmware on SAR715 using Linux 0.1 Gavin Henry 13
7/29/2019 Howto SAR715 Linux
14/16
Now, when I did this, the router booted completely, and didn't wipe any of my settings. I don't if it didfor Machasm or not.
The only thing now is to save the new code.First you must log in as admin
Password admin or whatever your isThen type console enable
Howto Upgrading firmware on SAR715 using Linux 0.1 Gavin Henry 14
7/29/2019 Howto SAR715 Linux
15/16
12).Next type flashfs update
You should see this
Howto Upgrading firmware on SAR715 using Linux 0.1 Gavin Henry 15
7/29/2019 Howto SAR715 Linux
16/16
Thats it!
If you now restart the router with restartyou should now have the new firmware loaded.
As I said, none of my settings were reset. I still had the same gateway IP and they same firewall rules,NAT rules etc, so I was very happy, but you may not.
The web interface looks good, but I haven't used any new features yet, as I just wanted to do anupgrade.
Disclaimer: I accept no responsibility if your router breaks as a result of following this guide or ifyour firmware gets corrupt. This is a howto guide only, and you use it at your own risk.
There, I'm safe :-)
Oh...Linux rules.....
Howto Upgrading firmware on SAR715 using Linux 0.1 Gavin Henry 16