This study aims to examine the impact of gamification using badge and leaderboard features in network security learning on students’ motivation and learning mastery at vocational high school (SMK). This research employed an experimental study method with a control group and an experimental group. The experimental class received learning treatment through gamification (badge–leaderboard), while the control class received conventional instruction. Data were collected using motivation questionnaires and learning outcome tests, then analyzed using statistical tests to determine differences between groups. The results indicate that the implementation of gamification significantly improved students’ learning motivation and increased learning mastery in network security subjects compared to conventional learning. Students in the experimental class demonstrated higher engagement, competitiveness, and active participation during the learning process, which positively affected their academic achievement. Therefore, gamification (badge–leaderboard) can be considered an effective instructional strategy to enhance motivation and learning mastery in vocational network security education.