Jump to content
Not connected, Your IP: 3.147.86.143

Leaderboard


Popular Content

Showing content with the highest reputation on 01/28/21 in all areas

  1. 1 point
    I wrote a script to do this for multiple websites for use with Network Manager's dispatcher service. See https://www.mankier.com/8/NetworkManager #!/bin/bash URL_LIST=("smtp.secureserver.net" "anothersite.com" "space-delimited.net") GATEWAY="192.168.0.1" IP_LIST=() for url in $URL_LIST do ip=`dig +short $url` IP_LIST+=("$ip") done for ips in $IP_LIST do ips=(`echo $ips | tr " " "\n"`) for ip in $ips do ip route add $ip via $gateway done doneAdd in the URLs you need, save it as root in /etc/NetworkManager/dispatcher.d as whatever you want to call it and it will run after connecting to a network.
×
×
  • Create New...