This is sw1 configuration, help to see what was wrong, static routing is with wrong
Vlan batch 10 20
#
DHCP enable
#
Interface Vlanif1
#
Interface Vlanif10
IP address 192.168.10.254 255.255.255.0
DHCP select interface
The DHCP server excluded - IP - address 192.168.10.1
The DHCP server lease 30 hour day 0 minute 0
DHCP server DNS - list 192.168.10.1 192.168.10.254
#
Interface MEth0/0/1
#
Interface GigabitEthernet0/0/1
The port link -type access
The port default vlan 10
#
Interface GigabitEthernet0/.two survivors
The port link -type access
The port default vlan 10
#
Interface GigabitEthernet0/0/24
The port link -type trunk
The port trunk allow - pass vlan 10 20
#
IP route -static 192.168.20.0 255.255.255.0 192.168.20.254
CodePudding user response:
You have a second switch configuration return route?CodePudding user response:
One way: you create a on LSW1 VLAN20, connect with LSW2 physical interface to VLAN20, in LSW1 IP address for the VLAN configuration (such as: 192.168.20.254), so the gateway is 192.168.20.254 VLAN20, on LSW1 enable routing (some switch routing functions is to through the command enabled), and so on LSW1 VLAN10 (192.168.10.0/24) and VLAN20 (192.168.20.0, 24) is the two LSW1 directly connected network, automatically generates two direct route, don't need to configure static routes can communication,CodePudding user response:
CodePudding user response:
This is the most simple configuration, all need routing data processing by SW1, if must use static routing, then use the trunk link is no good, want to add additional vlans (e.g., VLAN30), two switches will match VLAN30, and two switches VLAN30 to configure IP address (e.g., 192.168.30/24 subnet), then 192.168.30. The next hop address of X is the static routing,This solution is not very detailed, find their own data configuration,
CodePudding user response:
You in SW1 and SW2 connected interface configuration two IP addresses, such as: SW1, SW2 192.168.30.1/24:192.168.30.2/24Write a default route: SW1: IP route 0.0.0.0 0.0.0.0 192.168.30.2
SW2: IP route 0.0.0.0 0.0.0.0 192.168.30.1
I'm SW1 10.20.10.0/24 SW2:10.20.20.0/24
The hostname Switch
!
!
!
!
!
IP DHCP pool vlan10
The network 10.20.10.0 255.255.255.0
The default - the router 10.20.10.1
!
!
IP routing
!
!
Interface FastEthernet0/1
No switchport
IP address 10.20.60.1 255.255.255.0
Duplex auto
Speed auto
!
Interface FastEthernet0/2
Switchport access vlan 10
Switchport mode access
!
Interface FastEthernet0/3
Switchport access vlan 10
Switchport mode access
!
Interface Vlan10
IP address 10.20.10.1 255.255.255.0
!
IP classless
IP route 0.0.0.0 0.0.0.0 10.20.60.2
CodePudding user response:
The building Lord, you this is the layer 2 switches, layer 3 switches have vlanifCodePudding user response: