Merge remote-tracking branch 'refs/remotes/origin/main'

This commit is contained in:
Joey Hafner 2024-01-08 11:42:23 -08:00
commit bf96d7cb44
2 changed files with 22 additions and 14 deletions

View File

@ -138,4 +138,15 @@ set system login user admin authentication public-keys jafner425@gmail.com key $
To get a monitoring panel of bandwidth usage listed by connection on the internet, use `sudo iftop -i pppoe1`. To get a monitoring panel of bandwidth usage listed by connection on the internet, use `sudo iftop -i pppoe1`.
To instead get usage listed by connection on LAN, use `sudo iftop -p -i eth6` To instead get usage listed by connection on LAN, use `sudo iftop -p -i eth6`
[`iftop` docs](https://linux.die.net/man/8/iftop). Use [`pcap-filter'](https://www.tcpdump.org/manpages/pcap-filter.7.html) syntax for filtering with the `-f` flag. [`iftop` docs](https://linux.die.net/man/8/iftop). Use [`pcap-filter'](https://www.tcpdump.org/manpages/pcap-filter.7.html) syntax for filtering with the `-f` flag.
# Setting up the Aruba S2500-48P
Followed the instructions given in [this video](https://www.youtube.com/watch?v=HegeBkglsec)
1. Reset to factory settings.
2. Basic configuration (using static IP 192.168.1.9).
3. Flashed new firmware image (7.4.0.7, built 2021_07_07) to default boot partition.
4. Deleted stacking interfaces for 3rd and 4th SFP+ ports.
5. Flashed new firmware image (7.4.0.7, built 2021_07_07) to backup boot partition.
Additional reference: https://forums.serverbuilds.net/t/official-aruba-s2500-managed-ethernet-switch-poe-10gsfp/5038

View File

@ -1,26 +1,23 @@
#!/bin/vbash #!/bin/vbash
source /opt/vyatta/etc/functions/script-template source /opt/vyatta/etc/functions/script-template
# create copies of config for modification and backup # get current public IP
cp /config/config.boot /config/config.new NEW_IP=$(show interfaces pppoe pppoe1 | grep "inet\s" | cut -d ' ' -f 6)
cp /config/config.boot /config/backups/config.bk-$(date +%Y-%m-%d) # get old public IP
OLD_IP=$(show nat destination rules | grep 1100 | head -1 | tr -s ' ' | cut -d' ' -f 3)
show configuration commands | grep $OLD_IP | sed --expression="s/$OLD_IP/$NEW_IP/" > ipupdate.tmp
# switch mode to config
configure configure
# get current public IP source ipupdate.tmp
NEW_IP=$(run show interfaces pppoe pppoe1 | grep "inet\s" | cut -d ' ' -f 6)
# get old public IP
OLD_IP=$(run show nat destination rules | grep 1100 | head -1 | tr -s ' ' | cut -d' ' -f 3)
# edit the config.new file
sed -i "s/$OLD_IP/$NEW_IP/" /config/config.new
# apply the new config
load /config/config.new
{ # try commit, save, exit { # try commit, save, exit
commit && save && exit commit && save && exit
} || { # catch, exit discard and create a very basic error file } || { # catch, exit discard and create a very basic error file
exit discard exit discard
echo "Script failed. Write some real error handling." echo "Script failed. Write some real error handling."
} }
rm ipupdate.tmp