ip default-network and default-gateway commands
topstar
Member Posts: 36 ■■□□□□□□□□
in CCNA & CCENT
Hi
I need some clarification please. I under stand static routes and default routes but don’t quite get the default-gateway or default-network commands or when or how I should use then. I have a small home network with 3 routers so far and can set it up ok for static routes but on one router tonight I set it up with the default-network (and ip address) command. But I could only get a reply from directly connected networks (the other routers were set up with static routes).
I then configured all routers with rip (version 2) but on one router I left out 1 connected network but added it as a default-network command I was able to get a reply from it and when I vied the ip routeing tables on the other 2 routers it said something like this..
R* 0.0.0.0/0 (120/1) 172.16.1.1 serial 1
From what I can gather it was being advertised by rip but why would I need this or should I say why would I want this to happen .
I know I have not worded this the best but could someone please explain to me (in the simplest terms possible ) what default-gateway and default-network commands are used for and when I should use then.
Many thanks
Stephen
I need some clarification please. I under stand static routes and default routes but don’t quite get the default-gateway or default-network commands or when or how I should use then. I have a small home network with 3 routers so far and can set it up ok for static routes but on one router tonight I set it up with the default-network (and ip address) command. But I could only get a reply from directly connected networks (the other routers were set up with static routes).
I then configured all routers with rip (version 2) but on one router I left out 1 connected network but added it as a default-network command I was able to get a reply from it and when I vied the ip routeing tables on the other 2 routers it said something like this..
R* 0.0.0.0/0 (120/1) 172.16.1.1 serial 1
From what I can gather it was being advertised by rip but why would I need this or should I say why would I want this to happen .
I know I have not worded this the best but could someone please explain to me (in the simplest terms possible ) what default-gateway and default-network commands are used for and when I should use then.
Many thanks
Stephen
Comments
-
NightShade1 Member Posts: 433 ■■■□□□□□□□Okay
Look default-networks will just only works in a router you got a routing protocol and you got the networks added to it, the default network will work with it so they main different between ip default network command and ip route(static route command) its that the ip default network works with the routing protocol ok?
In other words if you want that the router propagate your default route the ip default network will do that... but if you just only want that the local router have the default route then you will use static ip route
The ip default gateway are just avalable on switches unless you config "no ip routing"
Another thing, when you configuring the ip default network you gotta put the classfull network on it
for example
Config)# ip default-network <Net classfull ID>
hope that helps -
topstar Member Posts: 36 ■■□□□□□□□□Hi
Thanks for the reply, I think I have got it but let me just clarify some of it with you.
I would use the default-network command if I wanted a default route passed through out my network, but could you please answer me this?
1 Why would I want this why not just let rip or any routing protocol advertise the network is it because on the other routers it is shown as any network.
Example with rip 0.0.0.0//0 (120/1) 172.16.1.1 serial 1
2 has the default-network any relevance on the router I put it on …
Example could I type in a default-network command on a router instead of a static route for that router (I tried this but it would not work but I may have configured it wrong)
As for the default-gateway is it used instead of static routes i.e... If a router receives any data for a destination it does not know about it forwards the data to the default-gateway
Many thanks for the help
Stephen -
NightShade1 Member Posts: 433 ■■■□□□□□□□Answering your questions
"i would use the default-network command if I wanted a default route passed through out my network, but could you please answer me this?
1 Why would I want this why not just let rip or any routing protocol advertise the network is it because on the other routers it is shown as any network.
Example with rip 0.0.0.0//0 (120/1) 172.16.1.1 serial 1 "
Okay ill explain you Why you want to use ip default network and how it works i guess that will answer your question...
You will use Ip default network if you wanted advertise this network as the default or last resort to the whole domain you see what i mean in here? the whole domain will look THAT network as the default network But if you used ip route default network then the router will not advertise that and it will be just the default route for that router.
In simple words suppose you got a router 1 2 and 3
if you got configured in router 1 ip default network
and router 2 or router 3 have a unkown package then they will will sent it to router 1 BECAUSE router one sent them a update that he has a default network
router 2 will have in his routing table
0.0.0.0 via 192.168.2.1 just to give you an example
he will see Ah! there is a default network ill sent my unknown package via 192.168.2.1
On router 1 you will have soemthing in the routing table like this
C* 192.168.1.0/24 is directly connected Fastethernet 0/0
then the package sended by router 2 he will sent it through FastEthernet 0/0
Let see the case you just got ip route 0.0.0.0 0.0.0.0 comand configured in R1
If a unknown package reach the R2 and it has not a default route on it, it will not know where to sent it so he will drop the package why? because router A didnt sent him any update about any default network because it wasnt configured and the thing that was configured was the ip route 0.0.0.0 0.0.0.0 command on it which means this will only work if the unkown package reach router A
"has the default-network any relevance on the router I put it on …
Example could I type in a default-network command on a router instead of a static route for that router (I tried this but it would not work but I may have configured it wrong) "
yes you can put a default network command to configure a default network INSTEAD the default static route command (ip route 0.0.0.0 .0.0.0.0 command)
And if you just tried this on router i mean you literally typed default-network "network number"
Then the command you used is wrong you should do this one
ip default-network "network number" type it without the ""(dunno how that is called in english....)
As for the default gateway it will just work if the ip routing is disabled from the IOS ver 12 it comes ON by default....
You will see this is used on switches for telneting hehe ifyou dont have that configured and you want to telnet from a different vlan of the manage vlan then you will have to set up a default gateway.
As far i know this works like this
I hope this already answered your questions if this didn't answer you questions sorry then i didn't understand what you were asking and ask me again.
PD:Remenber when you setting a default network you should put the the classful network ok?
Also if you are putting a default network on a router and you do this
in router 1 you configure
on serial 0 172.16.1.2/24
on serial 1 172.16.2.2/24
And then you do ip default network 172.16.0.0 it will not work...
Because he will not know which will be the default network serial 1 or serial 0 because both are in the same major network 172.16.0.0 ok? -
topstar Member Posts: 36 ■■□□□□□□□□Hi nightshade1
Thanks for taking the time to clarify that, I under stand it now. On the router I had configured as a default-network I had two networks in the 176.16 range and could not get to work on that router now I see why.
Again many thanks
Stephen