You are not logged in.
When I use the ip address command; eg:
ip address add local 192.168.77.10/29 dev eno1a default route with metric=0 (for the directly connected interface) is automatically added to the route table and shown with ip route show.
I've been reading the man page for ip address and I cannot figure out how to prevent it to manually created it afterwards.
Use case ?
I want to place a specific route for a specific computer before it (overriding the default route):
eg: metric=1 192.168.77.12 via 192.168.78.11 ### specific computer going via elsewhere
eg: metric=2 192.168.77.10/29 via 192.168.77.9 ### instead of default metric=0
Last edited by dawnofman (2022-04-17 17:32:01)
Offline
I've been reading the man page for ip address [...]
Sure?
ip address add local 192.168.77.10/29 dev eno1 metric 2Edit: I read your post again and might misunderstood it. If you want to route a specific IP via a specific gateway, just add the route. The metric should not be important if you have a correct network layout.
Last edited by Tarqi (2022-03-10 20:48:20)
Knowing others is wisdom, knowing yourself is enlightenment. ~Lao Tse
Offline
Sure?
Sure.
Edit: I read your post again and might misunderstood it. If you want to route a specific IP via a specific gateway, just add the route. The metric should not be important if you have a correct network layout.
from the man page: metric NUMBER ... priority of prefix route associated with address.
I didn't figure out that a metric following ip address add ... was for the default route created by it; somehow I thought of it as a way to bind it with another already-added custom route. My fault.
I suppose this will do the trick. Thanks for your advice
!
Offline