Sei sulla pagina 1di 3

configurar vlans

Switch(config)#vlan 12
Switch(config-vlan)#name vlan12
Switch(config-vlan)#exit
Switch(config)#
Switch(config)#interface range fa0/2-5
Switch(config-if-range)#sw
Switch(config-if-range)#switchport mode ac
Switch(config-if-range)#switchport mode access
Switch(config-if-range)#sw
Switch(config-if-range)#switchport ac
Switch(config-if-range)#switchport access vlan 11
Switch(config-if-range)#exit
Switch(config)#
Switch(config)#interface range fa0/6-10
Switch(config-if-range)#sw
Switch(config-if-range)#switchport mode a
Switch(config-if-range)#switchport mode access
Switch(config-if-range)#sw
Switch(config-if-range)#switchport acc
Switch(config-if-range)#switchport access vlan 12
ahora ponemos gateway como ip a la vlan
Switch(config)#interface vlan 11
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan11, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan11, changed state to up
Switch(config-if)#ip address 192.168.11.1 255.255.255.0
Switch(config-if)#exit

----Activar entoutamiento en el switch


Switch(config)#ip routing
---------------para asignar IP a un puerto, lo desactivamos como puerto de switch
y lo asinamos como puerto de router
----------auto eth0
iface eth0 inet static
address 192.168.1.100
gateway 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0

broadcast 192.168.1.255
/etc/init.d/networking restart

Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int
Switch(config)#interface fa0/24
Switch(config-if)#no sw
Switch(config-if)#no switchport
Switch(config-if)#ip ad
Switch(config-if)#ip address 192.168.100.1 255.255.255.0
Switch(config-if)#exit
Poner en modo trunk un puerto
Switch>ena
Switch#config t
Switch#config terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int
Switch(config)#interface fa0/1
Switch(config-if)#sw
Switch(config-if)#switchport tr
Switch(config-if)#switchport trunk en
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#sw
Switch(config-if)#switchport mode tr
Switch(config-if)#switchport mode trunk

Accecso a crear vlans


Switch#vlan database
Ver Tabla de enroutmaiento
Switch#show ip route

CONTROL DE ACCESO
Switch(config)#access-list
Switch(config)#access-list
Switch(config)#access-list
Switch(config)#access-list
Asignar el ACL a las vlan
Switch(config)#int

13
13
13
13

deny 192.168.13.0 0.0.0.255


pe
permit a
permit any

Switch(config)#interface vlan 11
Switch(config-if)#ip a
Switch(config-if)#ip ac
Switch(config-if)#ip access-group 13 out
Switch(config-if)#exit
Switch(config)#interface vlan 12
Switch(config-if)#ip access-group 13 out
Switch(config-if)#exit

listar interfaces
Switch(config)#do sh ip int br

guardar configuracion

write mem

Potrebbero piacerti anche