Thursday, May 5, 2022

Create Delete VLAN FreeBSD 12.3-Stable

Sebelumnya, load dulu kernel buat vlan
vi /boot/loader.conf
if_vlan_load=YES
Setelah itu reboot. Sebelum create vlan, perhatikan root interface/ethernet nya apa, di sini saya kasih contoh mlxen0 (Mellanox ConectX-3) 2 Port 40Gbps, ini port manteb bgt buat deploy router. Oh iya, cara load driver nya begini :
kldload mlx4en
Itu hanya bersifat sementara, kalau mau permanen, tambahkan script di /boot/loader.conf lalu reboot
mlx4en_load="YES"
Sekarang tips buat vlan interface. Untuk freebsd versi terbaru, crate vlan lebih mudah, contoh :
root@BSDRouter:~ # ifconfig vlan605 create
root@BSDRouter:~ # ifconfig vlan605 vlan 605 vlandev mlxen0
root@BSDRouter:~ # ifconfig vlan605 inet 10.70.70.2 netmask 255.255.255.252
root@BSDRouter:~ # ifconfig vlan605
vlan605: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=680703<RXCSUM,TXCSUM,TSO4,TSO6,LRO,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
        ether 00:02:c9:a3:0d:21
        inet 10.70.70.2 netmask 0xfffffffc broadcast 10.70.70.3
        groups: vlan
        vlan: 605 vlanpcp: 0 parent interface: mlxen0
        media: Ethernet autoselect (40Gbase-CR4 <full-duplex,rxpause,txpause>)
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
Lalu, kalau ingin destroy cukup ketikkan begini:
ifconfig vlan605 destroy
Kalau ingi disable vlan, ketikkan gini :
ifconfig vlan605 down
ok, itu hanya bersifat temporary. Kalau pengen kesimpen dan di load saat booting, pasang script di /etc/rc.conf
cloned_interfaces="vlan605" ifconfig_vlan605="inet 10.60.60.2 netmask 255.255.255.252 vlan 605 vlandev mlxen0" ifconfig_mlxen0="up"
setelah itu save, kemudian eksekusi :
service netif restart
Semoga Berguna :-)

No comments:

Post a Comment