cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
636
Views
0
Helpful
0
Replies

Configuring two VLANs in one switch

LightWorx
Level 1
Level 1

Hi,

I'm kind of new here and would like to get some help please.

I'm trying to configure a small business switch SG300-10P to do the following:

  1. Obtain internet connectivity from another switch with a different network IP, to be connected at port 9 or 10
  2. Allow internet connectivity to all other ports (1 to without affecting existing network or DHCP on these 8 ports.

So I tried to configure 2 VLANs, VLAN-1 on port 1 to 8, and VLAN-2 on port 9 to 10.

Here are some other details:

  • The switch IP is static which is 192.168.1.21
  • DHCP server will be enabled on the switch, so it shouldn't accept any DHCP from VLAN-2
  • all devices connected to VLAN-1 will be under 192.168.1 network, and port 9 & 10 will be under 192.168.20

Here's the VLAN config I tried:

!
interface range gigabitethernet 1 - 8
switchport mode access
switchport access vlan 1
!
interface range gigabitethernet 9 - 10
switchport mode access
switchport access vlan 2
!
ip routing
!
interface vlan 1
ip address 192.168.1.21 255.255.255.0
no ip address dhcp
no shutdown
!
interface vlan 2
ip address 192.168.20.1 255.255.255.0
no shutdown
!
exit

The starting-config.txt file can't be uploaded as it throws an error at the 'ip routing' line. Also, should I configure port 9 & 10 as trunk in this case? I'm sure there are other parts to be rectified as well.

Appreciate your help

0 Replies 0