-1

I want to simply modify routing rule in Linux. Now I have to add:

ip route add 5.3.4.3 via 10.4.4.4

ip route add 3.4.5.3 via 10.4.4.4

ip route add 200.45.32.3 via 10.4.4.4

ip route add 9.33.4.3 via 10.4.4.4

Does exist someting like ipset for ip route? I want to have this IP addresses in one list 5.3.4.3, 3.4.5.3, 200.45.32.3 and 9.33.4.3. I want to have only one route insted of 4(or more).

Thank you.

1 Answer 1

0

You will need 4 rules if you want to set the route for 4 different single IP.

Bu you could do a little script if you don't want to have to repeat the commands:

#!/bin/sh
GW=10.4.4.4
for ip in 5.3.4.3 3.4.5.3 200.45.32.3 9.33.4.3
do
  ip route add -host $ip gw $GW
done

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .