07-26-2016 05:05 PM - edited 03-08-2019 06:47 AM
Hello, I have two switches connected via a trunk.
Switch 1 has an SVI in VLAN 10 (192.168.10.1). Switch 2 has SVIs in VLAN 10 (192.168.10.2) and VLAN 20 (192.168.20.1).
My goal is to ping from switch 1 (192.168.10.1) to 192.168.20.1 on switch 2 but it cannot do that unless I add the command 'ip route 0.0.0.0 0.0.0.0 192.168.10.2'.
My question is why would my existing command 'ip default-gateway 192.168.10.2' also perform the same function ?
Thanks kindly for any help.
SWITCH 1
ip routing
!
!
spanning-tree mode pvst
!
interface FastEthernet0/1
switchport trunk encapsulation dot1q
switchport mode trunk
!
xxx
!
interface GigabitEthernet0/2
!
interface Vlan1
no ip address
shutdown
!
interface Vlan10
ip address 192.168.10.1 255.255.255.0
!
ip default-gateway 192.168.10.2
ip classless
!
ip flow-export version 9
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
end
SWITCH 2
ip routing
!
spanning-tree mode pvst
!
interface FastEthernet0/1
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface FastEthernet0/2
switchport access vlan 20
!
xxxxxxxxx
!
interface GigabitEthernet0/2
!
interface Vlan1
no ip address
shutdown
!
interface Vlan10
ip address 192.168.10.2 255.255.255.0
!
interface Vlan20
ip address 192.168.20.1 255.255.255.0
!
ip classless
!
ip flow-export version 9
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
end
Solved! Go to Solution.
07-26-2016 09:26 PM
Please rate helpful posts and mark correct answers.
07-26-2016 06:43 PM
Please rate helpful posts and mark correct answers.
07-26-2016 06:43 PM
Hello, thanks for that, however when I removed 'ip routing' and removed the 'ip route 0.0.0.0 0.0.0.0' command I cannot ping 192.168.20.1.
The switches can ping each other. Traceroute shows the ping is reaching 192.168.10.2 on Switch 2 but the ping return is not happening.
Can anyone see why this is happening ?
SWITCH 1
spanning-tree mode pvst
!
!
interface FastEthernet0/1
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface Vlan1
no ip address
shutdown
!
interface Vlan10
ip address 192.168.10.1 255.255.255.0
!
ip default-gateway 192.168.10.2
ip classless
!
ip flow-export version 9
!
07-26-2016 06:48 PM
Please rate helpful posts and mark correct answers.
07-26-2016 06:48 PM
Hello thanks Luke, yes to both of your questions. Here are the full configs.
I appreciate your help.
SWITCH1:
Current configuration : 1272 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
!
spanning-tree mode pvst
!
interface FastEthernet0/1
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface FastEthernet0/2
!
interface FastEthernet0/3
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface FastEthernet0/16
!
interface FastEthernet0/17
!
interface FastEthernet0/18
!
interface FastEthernet0/19
!
interface FastEthernet0/20
!
interface FastEthernet0/21
!
interface FastEthernet0/22
!
interface FastEthernet0/23
!
interface FastEthernet0/24
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
no ip address
shutdown
!
interface Vlan10
ip address 192.168.10.1 255.255.255.0
!
ip default-gateway 192.168.10.2
ip classless
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
!
!
end
SWITCH 2
Current configuration : 1377 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
!
!
ip routing
!
!
spanning-tree mode pvst
!
!
interface FastEthernet0/1
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface FastEthernet0/2
switchport access vlan 20
!
interface FastEthernet0/3
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface FastEthernet0/16
!
interface FastEthernet0/17
!
interface FastEthernet0/18
!
interface FastEthernet0/19
!
interface FastEthernet0/20
!
interface FastEthernet0/21
!
interface FastEthernet0/22
!
interface FastEthernet0/23
!
interface FastEthernet0/24
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
no ip address
shutdown
!
interface Vlan10
ip address 192.168.10.2 255.255.255.0
!
interface Vlan20
ip address 192.168.20.1 255.255.255.0
!
ip classless
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
!
!
end
07-26-2016 09:26 PM
Please rate helpful posts and mark correct answers.
07-26-2016 09:26 PM
thanks kindly Luke. Yes VLAN 20 was in existence.
Here is the output you requested:
Switch(config)#do sh ip int brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/1 unassigned YES unset up up
FastEthernet0/2 unassigned YES unset up up
FastEthernet0/3 unassigned YES unset down down
FastEthernet0/4 unassigned YES unset down down
FastEthernet0/5 unassigned YES unset down down
FastEthernet0/6 unassigned YES unset down down
FastEthernet0/7 unassigned YES unset down down
FastEthernet0/8 unassigned YES unset down down
FastEthernet0/9 unassigned YES unset down down
FastEthernet0/10 unassigned YES unset down down
FastEthernet0/11 unassigned YES unset down down
FastEthernet0/12 unassigned YES unset down down
FastEthernet0/13 unassigned YES unset down down
FastEthernet0/14 unassigned YES unset down down
FastEthernet0/15 unassigned YES unset down down
FastEthernet0/16 unassigned YES unset down down
FastEthernet0/17 unassigned YES unset down down
FastEthernet0/18 unassigned YES unset down down
FastEthernet0/19 unassigned YES unset down down
FastEthernet0/20 unassigned YES unset down down
FastEthernet0/21 unassigned YES unset down down
FastEthernet0/22 unassigned YES unset down down
FastEthernet0/23 unassigned YES unset down down
FastEthernet0/24 unassigned YES unset down down
GigabitEthernet0/1 unassigned YES unset down down
GigabitEthernet0/2 unassigned YES unset down down
Vlan1 unassigned YES unset administratively down down
Vlan10 192.168.10.2 YES manual up up
Vlan20 192.168.20.1 YES manual up up
07-27-2016 12:47 PM
no ip classless
Switch1#ping
Protocol [ip]:
Target IP address: 192.168.10.2
Repear count [5]: 10
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface: vlan10
Type of service [0]:
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:
Switch1#ping
Protocol [ip]:
Target IP address: 192.168.20.1
Repear count [5]: 10
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface: vlan10
Type of service [0]:
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:
07-29-2016 04:28 PM
07-29-2016 06:11 PM
Helllo, thanks for your help. A reboot got it working somehow !
07-30-2016 04:32 AM
07-27-2016 12:35 PM
conf t
!
vlan 20
!
exi
Please rate helpful posts and mark correct answers.
03-05-2021 03:01 AM
Perfect
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