Sure! Here's a basic network configuration in Cisco Packet Tracer that meets the requirements you described:
-
Create two switches (switch1 and switch2) and connect them using a trunk link. Make sure to enable trunking on the link to allow the transmission of traffic from both VLANs.
-
Create two PCs (PC1 and PC2) and connect them to the switches. Assign PC1 to VLAN 10 and PC2 to VLAN 20 using the appropriate port configurations on the switches.
-
Create a router (router1) and connect it to switch1. Configure the router with a default route pointing to the IP address of the DHCP server (DHCP server1).
-
Connect the DHCP server (DHCP server1) to router1. Configure the DHCP server to provide a separate DHCP pool for each VLAN. In this case, you will need to create two separate DHCP pools, one for VLAN 10 and one for VLAN 20.
-
Configure the appropriate IP addressing and default gateways on each device to allow them to communicate with each other. For example, PC1 should have an IP address in the 10.1.1.0/24 network and a default gateway of 10.1.1.1, while PC2 should have an IP address in the 10.2.2.0/24 network and a default gateway of 10.2.2.1.
-
Verify the network connectivity by pinging between devices and ensuring that traffic is flowing between the VLANs. You can also use the show commands on the switches and router to verify the configuration and verify that traffic is being properly routed and switched.
Here is a sample configuration for the switches and router:
Switch1:
interface FastEthernet0/1
switchport mode access
switchport access vlan 10
no ip address
interface FastEthernet0/2
switchport mode access
switchport access vlan 20
no ip address
interface FastEthernet0/3
switchport mode trunk
switchport trunk allowed vlan 10,20
interface FastEthernet0/4
switchport mode trunk
switchport trunk allowed vlan 10,20
Router1:
interface FastEthernet0/0
ip address 10.1.1.1 255.255.255.0
interface FastEthernet0/1
ip address 10.1.1.2 255.255.255.0
interface FastEthernet0/1.10
ip address 10.1.1.10 255.255.255.240
interface FastEthernet0/1.20
ip address 10.1.1.20 255.255.255.240
interface Serial0/0/0
ip address 192.168.1.1 255.255.255.0
interface Serial0/0/1
ip address 192.168.2.1 255.255.255.0
access-list 10 permit 10.1.1.0 0.0.0.255
access-list 10 permit 10.2.2.0 0.0.0.255
ip route 0.0.0.0 0.0.0.0 10.1.1.1
ip route 0.0.0.0 0.0.0.0 10.2.2.1
DHCP Server1:
ip address 192.168.1.1 255.255.255.0
dhcp-pool 10
default-router 10.1.1.1
domain-name "example.com"
domain-search "example.com"
lease 86400
dhcp-pool 20
default-router 10.2.2.1
domain-name "example.com"
domain-search "example.com"
lease 86400
Note: This is just a sample configuration and may need to be adjusted based on your specific network requirements and topology. It is always recommended to consult with a network professional or Cisco documentation for detailed instructions and best practices for configuring a network in Cisco Packet Tracer.