• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 292
  • Last Modified:

VLAN config problem!

I want to config vlan1 like this:
   network 192.168.2.0 255.255.0.0

But after apply, it auto change to this:

ip dhcp pool vlan1
   network 192.168.0.0 255.255.0.0
   default-router 192.168.1.1
   dns-server 8.8.8.8
!

Why that?
Thank you!
0
redstar01
Asked:
redstar01
1 Solution
 
Ernie BeekCommented:
So try:

Interface vlan1
ip address 192.168.2.0
Or whatever ip you want to give it.

The network scommand is used (as you can see) for assigning a scope in DHCP. For a vlan you define a 'virtual' interface within that vlan so that your machine can communicate over that vlan.
0
 
enachemcCommented:
use 192.168.2.1

the last number cannot be 0 or
0
 
Ernie BeekCommented:
Typo, should indeed be:


Interface vlan1
ip address 192.168.2.
1 Or whatever ip you want to give it.
0
A Cyber Security RX to Protect Your Organization

Join us on December 13th for a webinar to learn how medical providers can defend against malware with a cyber security "Rx" that supports a healthy technology adoption plan for every healthcare organization.

 
Marius GunnerudSenior Systems EngineerCommented:
What exactly are you trying to do? configure DHCP or configure an IP on the VLAN interface or have the VLAN interface receive an IP from DHCP?

If you are trying to configure a static IP on the VLAN interface then what erniebeek mentioned above is the way to do it. Though you will need to include the subnet mask

interface vlan 1
ip address 192.168.2.1 255.255.0.0

however if you are trying to configure DHCP then the reason it is changing from 192.168.2.0 to 192.168.0.0 is because of the subnet mask you are giving it. you would need to give it a subnet mask of 255.255.254.0 or some other range in the 3rd octet for that number to stay.
0
 
Marius GunnerudSenior Systems EngineerCommented:
oops. mistake in that subnet.  it would need to be 255.255.253.0 at the very least.
0
 
rochey2009Commented:
Hi,

configure the network with a subnet mask of 255.255.255.0 instead of 255.255.0.0

network 192.168.2.0 255.255.255.0
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now