1

enter image description here

Eve ng development environment. There is no access from another subnet to the switch. The switch has an int vlan 100 with an ip address, trunk port and ip default-gateway 192.168.100.1.

The router has virtual interfaces vlan 100 and 50. Ping is quietly passing from the router to the switch, but if you ping 192.168.50.1 from the switch, then this does not work. That is, the switch does not know about other subnets and does not use the ip default-gateway 192.168.100.1. I do not know how to solve this. Everything works in Cisco Packet Tracer, but not in eve ng.

switch configuration:

Building configuration...

Current configuration : 925 bytes
!
! Last configuration change at 12:21:46 UTC Mon Jun 24 2024
!
version 15.1
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
service compress-config
!
hostname Switch
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
!
ip cef
!
!
no ipv6 cef
ipv6 multicast rpf use-bgp
!
!
!
!
!
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
!
!
!
vlan internal allocation policy ascending
!
!
!
!
!
!
!
!
!
!
interface Ethernet0/0
 switchport trunk encapsulation dot1q
 switchport trunk allowed vlan 100
 switchport mode trunk
 duplex auto
!
interface Ethernet0/1
 duplex auto
!
interface Ethernet0/2
 duplex auto
!
interface Ethernet0/3
 duplex auto
!
interface Vlan100
 ip address 192.168.100.2 255.255.255.0
!
ip default-gateway 192.168.100.1
!
no ip http server
!
!
!
!
!
control-plane
!
!
line con 0
 logging synchronous
line aux 0
line vty 0 4
!
end

router configuration:


Current configuration : 1010 bytes
!
! Last configuration change at 12:28:16 UTC Mon Jun 24 2024
!
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
!
hostname Router
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
!
!
!
!
!
!
ip cef
no ipv6 cef
!
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
 no ip address
 duplex half
!
interface FastEthernet0/0.50
 encapsulation dot1Q 50
 ip address 192.168.50.1 255.255.255.0
!
interface FastEthernet0/0.100
 encapsulation dot1Q 100
 ip address 192.168.100.1 255.255.255.0
!
interface Ethernet1/0
 no ip address
 shutdown
 duplex full
!
interface Ethernet1/1
 no ip address
 shutdown
 duplex full
!
interface Ethernet1/2
 no ip address
 shutdown
 duplex full
!
interface Ethernet1/3
 no ip address
 shutdown
 duplex full
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
!
!
!
control-plane
!
!
line con 0
 stopbits 1
line aux 0
 stopbits 1
line vty 0 4
 login
!
!
end

enter image description here

enter image description here

0

1 Answer 1

1

On an L3 switch, ip default-gateway does not work.

You need to use ip route 0.0.0.0/0 (or configure more specific routes).

1
  • I think that is correct. Depending on the model of switch you are using/emulating, it may have 'ip routing' enabled by default. Try the command 'show ip route' to see if you have any default route actually in use. Right now it seems your switch only has a connected route for the 192.168.100.0/24 network because it has an interface with that network in up/up status. Commented Jun 24 at 14:08

Not the answer you're looking for? Browse other questions tagged or ask your own question.