Options

what IP for switch in VLAN?

walid97walid97 Member Posts: 79 ■■□□□□□□□□
Hi guys,

I have 2 switches with 3 VLANs that span them (with trunk ports):
The VLANs use different subnet like:
192.168.10.0/24
192.168.20.0/24
192.168.30.0/24

What IPs should I give to each switch? because trunking does not work without this IP (not IP for ports, but for switch itself)

Comments

  • Options
    viper75viper75 Member Posts: 726 ■■■■□□□□□□
    walid97 wrote:
    Hi guys,

    I have 2 switches with 3 VLANs that span them (with trunk ports):
    The VLANs use different subnet like:
    192.168.10.0/24
    192.168.20.0/24
    192.168.30.0/24

    What IPs should I give to each switch? because trunking does not work without this IP (not IP for ports, but for switch itself)

    Each switch has to have the same IP address as the subnet it's in, and you have to type the IP address in the "int vlan x prompt" for the switch.

    Example:

    Switch-1
    Int vlan x
    ip address 192.168.10.x 255.255.255.0
    no shut

    Switch-2
    Int vlan x
    ip address 192.168.20.x 255.255.255.0
    no shut

    Switch-3
    Int vlan x
    ip address 192.168.30.x 255.255.255.0
    no shut

    Keep in mind that you can not communicate between vlans without a router that has a fastethernet port. Like a 2600 series. icon_wink.gif

    ***You have to be in global-config mode to be able to config. the local vlans on your switches.***

    SWITCH_1#conf t
    Enter configuration commands, one per line. End with CNTL/Z.
    SWITCH_1(config)#int vlan xxx <---- Your vlan number
    SWITCH_1(config-subif)#

    Hope this helps.
    CCNP Security - DONE!
    CCNP R&S - In Progress...
    CCIE Security - Future...
  • Options
    walid97walid97 Member Posts: 79 ■■□□□□□□□□
    Oh..

    what I think is that we specify an IP for the switch itself with:
    Switch(config)#int vlan1
    Switch(config-if)#ip address 192.168.x.x 255.255.255.0

    vlan1 being the default.

    I dont think that we should specify IP for vlan2, vlan3 and vlan4 in the 2 switches !! Should we ?
  • Options
    linuxguylinuxguy Member Posts: 50 ■■□□□□□□□□
    If I am not mistaken, you must give the IP of the switch to the switch to set up the vlan. The switch must have an ip to function on the subnet. Sense vlans 'partition' the switch they have to all have ips.

    Some one else confirm/refute please.
    If you do not feel like a newbie you probably should. :)
  • Options
    viper75viper75 Member Posts: 726 ■■■■□□□□□□
    walid97 wrote:
    Oh..

    what I think is that we specify an IP for the switch itself with:
    Switch(config)#int vlan1
    Switch(config-if)#ip address 192.168.x.x 255.255.255.0

    vlan1 being the default.

    I dont think that we should specify IP for vlan2, vlan3 and vlan4 in the 2 switches !! Should we ?

    You must give the switch the IP address on the vlan you are going to use.

    Switch(config)#int vlan 2 (or whatever vlan number your going to use)
    Switch(config-if)#ip address 192.168.x.x 255.255.255.0
    CCNP Security - DONE!
    CCNP R&S - In Progress...
    CCIE Security - Future...
  • Options
    walid97walid97 Member Posts: 79 ■■□□□□□□□□
    So, if I have 2 switches and 3 vlans, each switch need this configuration:

    Switch1(config)#int vlan 2
    Switch1(config-if)#ip address 192.168.10.1 255.255.255.0
    Switch1(config)#int vlan 3
    Switch1(config-if)#ip address 192.168.20.1 255.255.255.0
    Switch1(config)#int vlan 4
    Switch1(config-if)#ip address 192.168.30.1 255.255.255.0

    Switch2(config)#int vlan 2
    Switch2(config-if)#ip address 192.168.10.2 255.255.255.0
    Switch2(config)#int vlan 3
    Switch2(config-if)#ip address 192.168.20.2 255.255.255.0
    Switch2(config)#int vlan 4
    Switch2(config-if)#ip address 192.168.30.2 255.255.255.0

    Switch3(config)#int vlan 2
    Switch3(config-if)#ip address 192.168.10.3 255.255.255.0
    Switch3(config)#int vlan 3
    Switch3(config-if)#ip address 192.168.20.3 255.255.255.0
    Switch3(config)#int vlan 4
    Switch3(config-if)#ip address 192.168.30.3 255.255.255.0

    IPs 192.168.10.4 till 192.168.10.254 can be assigned to the ports in Vlan2

    IPs 192.168.20.4 till 192.168.20.254 can be assigned to the ports in Vlan3

    IPs 192.168.30.4 till 192.168.30.254 can be assigned to the ports in Vlan4


    Does it work this way ?

    Thanks!
  • Options
    viper75viper75 Member Posts: 726 ■■■■□□□□□□
    walid97 wrote:
    So, if I have 2 switches and 3 vlans, each switch need this configuration:

    Switch1(config)#int vlan 2
    Switch1(config-if)#ip address 192.168.10.1 255.255.255.0
    Switch1(config)#int vlan 3
    Switch1(config-if)#ip address 192.168.20.1 255.255.255.0
    Switch1(config)#int vlan 4
    Switch1(config-if)#ip address 192.168.30.1 255.255.255.0

    Switch2(config)#int vlan 2
    Switch2(config-if)#ip address 192.168.10.2 255.255.255.0
    Switch2(config)#int vlan 3
    Switch2(config-if)#ip address 192.168.20.2 255.255.255.0
    Switch2(config)#int vlan 4
    Switch2(config-if)#ip address 192.168.30.2 255.255.255.0

    Switch3(config)#int vlan 2
    Switch3(config-if)#ip address 192.168.10.3 255.255.255.0
    Switch3(config)#int vlan 3
    Switch3(config-if)#ip address 192.168.20.3 255.255.255.0
    Switch3(config)#int vlan 4
    Switch3(config-if)#ip address 192.168.30.3 255.255.255.0

    IPs 192.168.10.4 till 192.168.10.254 can be assigned to the ports in Vlan2

    IPs 192.168.20.4 till 192.168.20.254 can be assigned to the ports in Vlan3

    IPs 192.168.30.4 till 192.168.30.254 can be assigned to the ports in Vlan4


    Does it work this way ?

    Thanks!

    No...like this:

    Switch1(config)#int vlan 2
    Switch1(config-if)#ip address 192.168.10.1 255.255.255.0

    Switch2(config)#int vlan 3
    Switch2(config-if)#ip address 192.168.20.2 255.255.255.0

    Switch3(config)#int vlan 4
    Switch3(config-if)#ip address 192.168.30.3 255.255.255.0

    Assign fastethernet ports on switch1 to vlan 2
    Assign fastethernet ports on switch2 to vlan 3
    Assign fastethernet ports on switch3 to vlan 4

    Make one port on each switch is a trunk that will be connecting to another switch. The switches will communicate with eachother but that's about it. Host from vlan 2 will not be able to communicate with host on vlan 3. That's when a layer 3 (router) device comes in.

    No Intervlan routing will occur...because you have no router to route between vlans. Only nodes on vlan2 will communicate with eachother same is true for vlan 3 and 4.
    CCNP Security - DONE!
    CCNP R&S - In Progress...
    CCIE Security - Future...
Sign In or Register to comment.