04-16-2023 04:50 AM
I cannot ping router interface from switch
I have connected router and a layer 2 switch
Configuration of router
#int gig0/0/0
#ip add 192.168.1.1 255.255.255.0
#no sh
Configuration of switch
#int f0/1
#switchport mode trunk
ip default-gateway 192.168.1.1
*encapsulation are done correctly
*interfaces are correctly mentioned
* cables are straight
Still the switch cannot ping the router
Please help at the earliest
Solved! Go to Solution.
04-16-2023 07:32 AM - edited 04-16-2023 07:35 AM
Hello @r71296231
You can not ping from a layer2 switch. It does not matter if you have default gateway or not. The only way to ping is the switch to have a interface vlan.
Do like this:
Switch.
conf t
vlan 100
int vlan 100
ip add 192.168.1.2 255.255.255.0
int f0/1
switch mode trunk
Router:
int gig0/0/0
no ip add
int gig0/0/0.100
encapsulatio dot1q 100
ip add 192.168.1.1 255.255.255.0
then ping from switch to router.
04-16-2023 05:07 AM
Please help guys
04-16-2023 07:32 AM - edited 04-16-2023 07:35 AM
Hello @r71296231
You can not ping from a layer2 switch. It does not matter if you have default gateway or not. The only way to ping is the switch to have a interface vlan.
Do like this:
Switch.
conf t
vlan 100
int vlan 100
ip add 192.168.1.2 255.255.255.0
int f0/1
switch mode trunk
Router:
int gig0/0/0
no ip add
int gig0/0/0.100
encapsulatio dot1q 100
ip add 192.168.1.1 255.255.255.0
then ping from switch to router.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide