Juniper switches are equipped with a USB interface, which supports system upgrades, data storage and file transfer. It can be used to back up switch configuration files and log files. Meanwhile, users can upload configuration files and script files to realize automatic device configuration, network monitoring and fault troubleshooting. To upload files to a Juniper switch via USB, you need to mount the USB drive first.
This article introduces the complete operation process of USB file upload with a practical case.
Table 1 Parameter Description
|
Item |
Description |
|
Switch Model |
QFX5120-32C-AFI |
|
upload file name |
testoptical.sh |
|
USB file path |
/dev/da0p1 |
|
Mount Path |
/mnt/usb1 |
|
File upload storage path |
/var/tmp |
I. Mount USB Drive on Juniper Switch
1. Run the following command to view system directories. The dev directory stores all device files of the switch:
ls /
2. Run the following command to enter the /mnt folder:
cd /mnt/
Run the following command to create a usb1 folder for USB mounting:
mkdir usb1
3. Run the following command to complete USB mounting. The USB device path is /dev/da0p1, and the mount path is /mnt/usb1:
mount_msdosfs /dev/da0p1 /mnt/usb1
Run the following command to check whether the mounting is successful:
ls /mnt/usb1
II. Upload Files to Juniper Switch via USB
1. Run the following command to copy the target file to the switch storage path /var/tmp:
cp /mnt/usb1/testoptical.sh /var/tmp
2. Run the following command to enter the /var/tmp directory:
cd /var/tmp
Run the following command to filter and verify the uploaded file (use the keyword test to search for testoptical.sh):
ls | grep test
3. Run the following command to unmount the USB drive:
umount /dev/da0p1
Run the following command to confirm the unmount result:
df -h
Moduletek provides a full range of optical module products compatible with Juniper switches.