Absolutely and this route will take precedence for this particular host as it is more specific.
I understand that but, I wanted to know if I had a connected interface with a subnet on, could I then point this subent somewhere else using a static route, or would it always go out of the connected interface ?
I mean, I have a router with 2 interfaces, say one interface on 192.168.1.1/24 ann the other on 10.1.1.1/24, if I point a static route say 192.168.1.0/24 through the 10.1.1.1 interface woult this work? if not I guess it would allow a host or further subnetted route as its a longer match, please help
Hai Friends, this topic is going for a long... lets put an end to it..
It will give preferance to the connected interface. Please find the below, output form my test router..
*Mar 1 00:47:09.055: %SYS-5-CONFIG_I: Configured from console by consoleroute
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is 100.100.100.1 to network 0.0.0.0
18.104.22.168/32 is subnetted, 1 subnets
C 22.214.171.124 is directly connected, Loopback0
126.96.36.199/30 is subnetted, 1 subnets
C 100.100.100.0 is directly connected, FastEthernet0/0
S* 0.0.0.0/0 [1/0] via 100.100.100.1
Router#sh run | in ip route
ip route 0.0.0.0 0.0.0.0 100.100.100.1
ip route 188.8.131.52 255.255.255.255 100.100.100.1
ip route 100.100.100.2 255.255.255.255 100.100.100.1
I have configured static route for loopback0 and fast ethernet interface IP addresses.. But in the routing table it will shows only the connected one..
Hope this clear the doubts..