cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3658
Views
10
Helpful
7
Replies

How to configure a static route with a next hop that is in a vlan?

paperangel220
Level 1
Level 1

I am using Packet Tracer for my configurations. In my packet tracer, I have a router, R1, that is connected to a multilayer switch, MS1. MS1 is connected to another router, R2.

The network between R1 and MS1 is 192.168.0.0/24, and the network between MS1 and R2 is 172.16.0.0/24.

 

On R1, I would like to configure a static route to 172.16.0.0/24 using a next hop address on MS1. I have vlan 100 configured on MS1 with the IP address 192.168.0.2/24. I'm wondering what commands I should run on Packet Tracer to set a static route to that IP.  "ip route 172.16.0.0 255.255.255.0 192.168.0.2" does not seem to be enough, because I am unable to ping R2, which has an IP of 172.16.0.2.

 

I know I can do "no switchport" on MS1's interface that is connected to R1, and configure 192.168.0.2 on that interface, but I wonder if it is possible to set the next hop to an IP address that is on MS1's vlan, and if so, what commands to do so on Packet Tracer.

1 Accepted Solution

Accepted Solutions

 

Fist of all, is ip routing On? those switches come with no ip routing command in PT. Use show ip route

then check interface SVI for UP /up state with show ip interface brief.  

if switch ports are not trunks, then make sure they are access mode with vlan x appropriately.

 

Regards, ML
**Please Rate All Helpful Responses **

View solution in original post

7 Replies 7

Hello

can you attach the PT file please 


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Joseph W. Doherty
Hall of Fame
Hall of Fame

Does R2 also have a static to 192.168.0.0/24?  If not, pinging R2 from 192.168.0.0/24, R2 will not know where to send the reply.

You can also see this issue if pinging R2 from MS1 if using the 192.168.0.0/24 network.

Yes, R2 does have a static route to 192.168.0.0/24. 

 

This is what the topology looks like:

topology.PNG

All of the devices are default except for the configurations that I entered:

On R1:

interface GigabitEthernet0/0/0
ip address 192.168.0.1 255.255.255.0
no shutdown exit ip route 172.16.0.0 255.255.255.0 192.168.0.2

On MS1:

interface Vlan100
ip address 192.168.0.2 255.255.255.0
interface Vlan200
ip address 172.16.0.1 255.255.255.0

On R2:

interface GigabitEthernet0/0/0
ip address 172.16.0.2 255.255.255.0
exit 
ip route 192.168.0.0 255.255.255.0 172.16.0.1 

 

 

Fist of all, is ip routing On? those switches come with no ip routing command in PT. Use show ip route

then check interface SVI for UP /up state with show ip interface brief.  

if switch ports are not trunks, then make sure they are access mode with vlan x appropriately.

 

Regards, ML
**Please Rate All Helpful Responses **

I turned on ip routing and set the interfaces as access links. Now I can ping successfully. Thank you for the help!

Does MS1 have ip routing added,

 

Can you post from all devices?

 

show run (from MS1) - why i am asking does the MS1 port right VLAN / or Trunk config that connected to respected routers?

show ip route

show ip interface brief

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Translator
Community Manager
Community Manager

First, you need to enable routing on your router.
Second, for example, you need to create a second VLAN (for example, 101) and assign an IP address, such as 172.16.0.2.
In this case, to bind to R1 (100) and R2 (101), you must configure the access vlan of the switch, respectively.
Next, set the static path to R2 through 101VLAN.

Review Cisco Networking for a $25 gift card