Hy everyone.
I made two networks on packet tracer an linked them with a router
I can ping any interface on both netwoks as long as it's on the same network.
But when i try to ping from one netwok to another i can't.
I know that the problem is in the routing table of the router, I couldn't configure it graphically.
The ip of router in both LANs is 192.168.0.254/24 and 192.168.1.254/24.
-
do you put the deffault gateway on the pc/laptop ?– Sefrian NurhamzahCommented Aug 28, 2017 at 4:33
-
You need to edit your question to include the router configuration.– Ron Maupin ♦Commented Jan 25, 2018 at 14:43
-
Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer.– Ron Maupin ♦Commented Feb 21, 2018 at 16:27
3 Answers
The most basic topology you can build involving a router is
Host A -- Interface 0 [Router] Interface 1 -- Host B
If you set:
Host A
- IP address: 192.168.0.1
- Subnet Mask: 255.255.255.0
- Gateway: 192.168.0.254
Router Interface 0
- IP address: 192.168.0.254
- Subnet Mask: 255.255.255.0
Router Interface 1
- IP address: 192.168.1.254
- Subnet Mask: 255.255.255.0
Host B
- IP address: 192.168.1.1
- Subnet Mask: 255.255.255.0
- Gateway: 192.168.1.254
And if all links are up, host A should be able to ping host B
You don't have to add route on the router, since both networks are directly connected so the route to the two networks are already present in the router forwarding table.
But you must tell host A and B how to reach a remote network, and this is the role of the "(default) gateway" parameter which basically says "If don't know how to reach this network, send the packet to this address" I.E. to the router.
-
indeed i did as you said but when packets arrive to router form network 1. it drops them and send a failure packet back . Commented Aug 28, 2017 at 10:46
-
then you need to edit your question and copy the configuration of the router and the result of a "show ip route" into it (using the preformatted text option)– JFLCommented Aug 28, 2017 at 10:50
You will have to set a default gateway on your hosts to point to:
HostA: Default Gateway 192.168.0.254
HostB: Default Gateway 192.168.1.254
-
Your answer seems to say that there are two routers, but the question is about two networks on a single router. No static routes are needed because a single router will have the routes for both networks to which it is connected.– Ron Maupin ♦Commented Jan 25, 2018 at 14:42
-
Sorry for the mistake, You are right he is talking about 1 router only Commented Jan 29, 2018 at 9:11
So you have two host (a) and (b)
When configuring two IP addresses on a router you wouldn’t really need to ping the Two IP addresses configured on the same router.
When two host use the same router they have separate IP addresses assigned to them, but these host can talk to each other locally.
So for example if the two host were connected to a switch, they could interact with one another if in the same VLAN. If two host are in separate VLANs they cannot interact with each other unless a router is in between those two host which is called router on a stick which can route the packets between two host in two separate VLANs.
Hope this helps