Backup configuration of TP-Link switches

I wrote a script for backup configuration of TP-Link switches.
The script runs on Linux where the TFTP server is running, it is connected via telnet to the switch and the configuration command is sent to the specified TFTP, when the telnet connection is closed, the file is moved to the desired directory, and the last command deletes files longer than 30 days, as more of them I do not need to store.
You can also make a copy of all the files in the cloud every month.
As you can see, before entering a password in the script, you can not pause.

#!/bin/bash
{
echo "PASSWORD";
echo "enable";
echo "PASSWORD";
echo "copy startup-config tftp ip-address 192.168.0.5 filename tplink";
sleep 2;
echo "exit";
sleep 1;
echo "exit";
} | telnet 192.168.0.110

mv /srv/tftp/tplink.cfg /backups/devices/tplink/`date +%Y-%m-%d`_tplink.cfg
find /backups/devices/tplink/ -type f -mtime +30 -exec rm {} \;

The reboot script of Wi-Fi routers TP-Link

Below is an example of the TP-Link router reboot script, I will test it on TL-WR720N 2.0 from Ubuntu Server.

#!/bin/sh
ROUTER_IP="192.168.24.174"
USERNAME="admin"
PASSWORD="admin"

# exit if router is down
ping -q -c 1 "$ROUTER_IP" > /dev/null || exit

curl --basic --user "$USERNAME:$PASSWORD" -A "Mozilla/4.73 [en] (X11; U; Linux 2.2.15 i686)" --refer "http://$ROUTER_IP" "$ROUTER_IP/userRpm/SysRebootRpm.htm?Reboot=reboot"

The contents of the script will be placed in a new file, for example, using the nano editor (“CTRL+X” to exit and “y” to save the changes):

nano file.sh

And make it executable:

chmod 777 file.sh

After this, we execute:

./file.sh

Similarly, you can perform other functions instead of rebooting.

HP Pavilion dv7 Repair – White Screen

Noticed recently the appearance of a white screen at the time of work on the laptop HP Pavilion dv7.
When switching to an external monitor and back by a combination with the Fn key, the image was displayed normally, but after a while the problem appeared again.

The main reason for this phenomenon is likely to be a damaged or poor contact on the plume going to the display.
In my case, its disconnection/connection did not solve the problem, I had to order it on Aliexpress, it’s not expensive there.
Under the battery is written the full name of the laptop model for which you need to order a cable.

After replacing the loop, the problem was solved.

The solution to the error “IP overlaps with VlanXXX. VlanXXX: incorrect IP address assignment”

It was necessary to replace the L3 switch of HP with Cisco once and after a similar switch configuration Cisco noticed an error:

172.16.63.0 overlaps with Vlan111
Vlan121: incorrect IP address assignment

As it turned out the network Vlan111 172.16.0.0/18 was ending at 172.16.63.254, it crossed with Vlan121 172.16.63.0/24.

The HP 5800 switch was configured before that and he did not say anything about it, and Cisco refused to accept the command.

Therefore, since IP addresses were used little in the Vlan111 172.16.0.0/18 network, the problem was solved by reducing the mask to 172.16.0.0/19.

After that, the IP address was successfully registered to the Vlan121 interface.

Done.

Hard reset on Samsung GT-I9505 Galaxy S4

Describe the points for the process of a full reset on the Samsung GT-I9505 Galaxy S4:

1) Turn off the phone

2) Simultaneously press and hold three buttons: “Volume +”, “Home” and “Turn on”

3) After the vibration, release the “Power on” button, when the menu appears, release the rest

4) From the menu, you can move up/down with the volume buttons, so select “wipe data/factory reset”

5) Confirm with the “Power” button

6) Then, in the same way, select “Yes — delete all user data”

7) Wait until the user data is cleared and the settings are reset, when the menu appears, select “reboot system now” to reboot the phone.

Done.

Port isolation on Foxgate switches

For the test, I will configure on the Foxgate S6224-S4, S6224-S2, S6208, and so on.

Connect to the switch through the console or telnet and switch to the configuration mode:

enable
config

Let’s create a group of isolated ports and add ports to it that do not need to see each other (in my case, clients are from 1 to 24):

isolate-port group users
isolate-port group users switchport interface ethernet 1/1-24

The command is the same on all Foxgate switches, but port numbers may differ, for example on S6224-S2 I configured it like this:

isolate-port group users
isolate-port group users switchport interface ethernet 0/0/1-24

After adding the ports to the group they will not see each other, but they will see the ports that are not in the group, I have the 25 port is the uplink on which the Internet comes, because it is not in the group, it sees all the ports, and the ports that the groups see him.

Let’s see the list of ports in the users group:

show isolate-port group users

Leave the configuration mode and save the settings:

exit
write