Difference between revisions of "Mikrotik: VLAN"

From OnnoWiki
Jump to navigation Jump to search
(Created page with " /interface vlan add name=vlan1 vlan-id=11 interface=ether1 add name=vlan2 vlan-id=12 interface=vlan1 /interface vlan add name=VLAN2 vlan-id=2 interface=ether1 disable...")
 
Line 38: Line 38:
  
  
 +
==VLAN Contoh==
  
 +
/interface vlan
 +
add comment="HR" interface=ether2 name="VLAN 100 - HR" vlan-id=100
 +
add comment="Accounting" interface=ether2 name="VLAN 150 - Accounting" vlan-id=150
 +
add comment="Guests" interface=ether2 name="VLAN 175 - Guests" vlan-id=175
  
 +
/ip address
 +
add address=192.168.100.1/24 comment="HR Gateway" interface="VLAN 100 - HR"
 +
add address=192.168.150.1/24 comment="Accounting Gateway" interface="VLAN 150 - Accounting"
 +
add address=192.168.175.1/24 comment="Guests Gateway" interface="VLAN 175 - Guests"
 +
 +
/ip pool
 +
add name=HR ranges=192.168.100.2-192.168.100.254
 +
add name=Accounting ranges=192.168.150.2-192.168.150.254
 +
add name=Guests ranges=192.168.175.2-192.168.175.254
 +
 +
/ip dhcp-server network
 +
add address=192.168.100.0/24 comment="HR Network" dns-server=8.8.8.8,8.8.4.4 gateway=192.168.100.1
 +
add address=192.168.150.0/24 comment="Accounting Network" dns-server=8.8.8.8,8.8.4.4 gateway=192.168.150.1
 +
add address=192.168.175.0/24 comment="Guest Network" dns-server=8.8.8.8,8.8.4.4 gateway=192.168.175.1
 +
 +
/ip dhcp-server
 +
add address-pool=HR disabled=no interface="VLAN 100 - HR" name=HR
 +
add address-pool=Accounting disabled=no interface="VLAN 150 - Accounting" name=Accounting
 +
add address-pool=Guests disabled=no interface="VLAN 175 - Guests" name=Guests
  
 
==Referensi==
 
==Referensi==

Revision as of 09:20, 25 November 2018


/interface vlan
add name=vlan1 vlan-id=11 interface=ether1
add name=vlan2 vlan-id=12 interface=vlan1


/interface vlan
add name=VLAN2 vlan-id=2 interface=ether1 disabled=no
add name=VLAN3 vlan-id=3 interface=ether1 disabled=no
add name=VLAN4 vlan-id=4 interface=ether1 disabled=no


/ip address 
add address=10.10.20.1/24 interface=VLAN2
add address=10.10.30.1/24 interface=VLAN3
add address=10.10.40.1/24 interface=VLAN4


VLAN trunking

Slash32.png

RouterA:

/ip address add address=10.22.0.1/24 interface=ether1
/interface vlan add interface=ether2 vlan-id=1 name=vlan1
/ip address add address=10.22.0.1/32 interface=vlan1 network=10.23.0.1
/ip route add gateway=10.23.0.1 dst-address=10.23.0.0/24

RouterB:

/ip address add address=10.23.0.1/24 interface=ether1
/interface vlan add interface=ether2 vlan-id=1 name=vlan1
/ip address add address=10.23.0.1/32 interface=vlan1 network=10.22.0.1
/ip route add gateway=10.22.0.1 dst-address=10.22.0.0/24


VLAN Contoh

/interface vlan
add comment="HR" interface=ether2 name="VLAN 100 - HR" vlan-id=100
add comment="Accounting" interface=ether2 name="VLAN 150 - Accounting" vlan-id=150
add comment="Guests" interface=ether2 name="VLAN 175 - Guests" vlan-id=175
/ip address
add address=192.168.100.1/24 comment="HR Gateway" interface="VLAN 100 - HR"
add address=192.168.150.1/24 comment="Accounting Gateway" interface="VLAN 150 - Accounting"
add address=192.168.175.1/24 comment="Guests Gateway" interface="VLAN 175 - Guests"
/ip pool
add name=HR ranges=192.168.100.2-192.168.100.254
add name=Accounting ranges=192.168.150.2-192.168.150.254
add name=Guests ranges=192.168.175.2-192.168.175.254
/ip dhcp-server network
add address=192.168.100.0/24 comment="HR Network" dns-server=8.8.8.8,8.8.4.4 gateway=192.168.100.1
add address=192.168.150.0/24 comment="Accounting Network" dns-server=8.8.8.8,8.8.4.4 gateway=192.168.150.1
add address=192.168.175.0/24 comment="Guest Network" dns-server=8.8.8.8,8.8.4.4 gateway=192.168.175.1
/ip dhcp-server
add address-pool=HR disabled=no interface="VLAN 100 - HR" name=HR
add address-pool=Accounting disabled=no interface="VLAN 150 - Accounting" name=Accounting
add address-pool=Guests disabled=no interface="VLAN 175 - Guests" name=Guests

Referensi

Pranala Menarik