Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
558 B
5
Indexable
Never
  GNU nano 5.6.1                                vrack4.sh
#!/bin/bash

gateway=$(ip route | awk '/default / {print $3}'y)
broadcast=$(ip route | awk 'NR==2 {print $1}')
readarray -t interfaces < <(basename -a /sys/class/net/* | awk '/eth/{print $1}')

for x in $interfaces
do
ip rule add from "$broadcast" table vrack
ip route add "$broadcast" dev "${interfaces[@]}" table vrack
ip route add default via "$gateway" dev "${interfaces[@]}" table vrack
ip route add "$broadcast" dev "${interfaces[@]}" table vrack

done

systemctl restart NetworkManager.service
Leave a Comment