Skip to content

Commit

Permalink
N network scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
dvarrui committed Feb 24, 2023
1 parent b38758a commit de4ca21
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
23 changes: 23 additions & 0 deletions install/linux/set-static-ip.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
# Set static IP
DEV=eth0

echo "----------------"
echo "Network settings"
echo "----------------"
echo "Device | $DEV"
echo -n "Format N.N.N.N | IP? "
read IP
echo -n "Default 16 | Mask? "
read MASK
if [ -z $MASK ];
then
MASK=16
fi

echo "----------------"

ip addr add $IP/$MASK dev $DEV
ip route delete default
ip route add default via $IP dev $DEV

9 changes: 9 additions & 0 deletions install/linux/show-network.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
# Show network

echo "----- IP -----"

ip link

echo "----- Route ------"
ip route

0 comments on commit de4ca21

Please sign in to comment.