Configuring Vlans and DHCP
Configuring Vlans and DHCP
The Cisco Secure Router 520 Series routers support clients on both physical LANs and virtual LANs
(VLANs). The routers can use the Dynamic Host Configuration Protocol (DHCP) to enable automatic
assignment of IP configurations for nodes on these networks.
Figure 5-1 shows a typical deployment scenario with two physical LANs connected by the router and
two VLANs.
Figure 5-1 Physical and Virtual LANs with DHCP Configured on the Cisco Router
3
1
2
4
92339
1 Fast Ethernet LAN (with multiple networked devices)
2 Router and DHCP server—Cisco Secure Router 520 Series router—connected to the Internet
3 VLAN 1
4 VLAN 2
DHCP
DHCP, which is described in RFC 2131, uses a client/server router for address allocation. As an
administrator, you can configure your Cisco Secure Router 520 Series router to act as a DHCP server,
providing IP address assignment and other TCP/IP-oriented configuration information to your
workstations. DHCP frees you from having to manually assign an IP address to each client.
When you configure a DHCP server, you must configure the server properties, policies, and DHCP
options.
Note Whenever you change server properties, you must reload the server with the configuration data from the
Network Registrar database.
VLANs
The Cisco Secure Router 520 Series routers support four Fast Ethernet ports on which you can configure
VLANs.
VLANs enable networks to be segmented and formed into logical groups of users, regardless of the
user’s physical location or LAN connection.
Configuration Tasks
Perform the following tasks to configure this network scenario:
• Configure DHCP
• Configure VLANs
Note The procedures in this chapter assume you have already configured basic router features as well as
PPPoE or PPPoA with NAT. If you have not performed these configurations tasks, see Chapter 1, “Basic
Router Configuration,” Chapter 3, “Configuring PPP over Ethernet with NAT,” and Chapter 4,
“Configuring PPP over ATM with NAT” as appropriate for your router.
Configure DHCP
Perform these steps to configure your router for DHCP operation, beginning in global configuration
mode:
Command Purpose
Step 1 ip domain name name Identifies the default domain that the router uses to
complete unqualified hostnames (names without a
Example: dotted-decimal domain name).
Router(config)# ip domain name smallbiz.com
Router(config)#
Step 3 ip dhcp excluded-address low-address Specifies IP addresses that the DHCP server
[high-address] should not assign to DHCP clients. In this
example, we are excluding the router address.
Example:
Router(config)# ip dhcp excluded-address
192.168.9.0
Command Purpose
Step 4 ip dhcp pool name Creates a DHCP address pool on the router and
enters DHCP pool configuration mode. The name
Example: argument can be a string or an integer.
Router(config)# ip dhcp pool dpool1
Router(dhcp-config)#
Step 5 network network-number [mask | prefix-length] Defines subnet number (IP) address for the DHCP
address pool, optionally including the mask.
Example:
Router(dhcp-config)# network 10.10.0.0
255.255.255.0
Router(dhcp-config)#
Step 6 import all Imports DHCP option parameters into the DHCP
portion of the router database.
Example:
Router(dhcp-config)# import all
Router(dhcp-config)#
Step 7 default-router address [address2...address8] Specifies up to 8 default routers for a DHCP client.
Example:
Router(dhcp-config)# default-router
10.10.10.10
Router(dhcp-config)#
Step 9 domain-name domain Specifies the domain name for a DHCP client.
Example:
Router(dhcp-config)# domain-name cisco.com
Router(dhcp-config)#
Configuration Example
The following configuration example shows a portion of the configuration file for the DCHP
configuration described in this chapter.
ip dhcp excluded-address 192.168.9.0
!
ip dhcp pool dpool1
import all
network 10.10.0.0 255.255.255.0
default-router 10.10.10.10
dns-server 192.168.35.2
domain-name cisco.com
!
ip domain name smallbiz.com
ip name-server 192.168.11.12
Message Received
BOOTREQUEST 0
DHCPDISCOVER 0
DHCPREQUEST 0
DHCPDECLINE 0
DHCPRELEASE 0
DHCPINFORM 0
Message Sent
BOOTREPLY 0
DHCPOFFER 0
DHCPACK 0
DHCPNAK 0
Router#
Configure VLANs
Perform these steps to configure VLANs on your router, beginning in privileged EXEC mode:
Command Purpose
Step 1 vlan database Enters VLAN configuration mode.
Example:
Router# vlan database
Router(vlan)#
Step 2 vlan vlan-id [media type] [name vlan-name] Adds VLANs, with identifiers ranging from 2 to
1001.
Example: For details about this command and additional
Router(vlan)# vlan 2 media ethernet name parameters that can be set, see the Cisco IOS
VLAN0002
Switching Services Command Reference.
VLAN 2 added:
Name: VLAN0002
Media type: ETHERNET
Router(vlan)# vlan 3 media ethernet name
red-vlan
VLAN 3 added:
Name: red-vlan
Media type: ETHERNET
Router(vlan)#
Command Purpose
Step 1 interface switch port id Specifies the switch port that you want to assign
to the VLAN.
Example:
Router(config)# interface FastEthernet 2
Router(config-if)#
Example:
Router(config-if)# switchport access vlan 2
Router(config-if)#
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 1002 1003
2 enet 100002 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 1 1003
1003 tr 101003 1500 1005 0 - - srb 1 1002
1004 fdnet 101004 1500 - - 1 ibm - 0 0
1005 trnet 101005 1500 - - 1 ibm - 0 0