本教程在VirtualBox運行kali linux
第一步:網路設置為橋接模式
為了抓包方便,這里啟用了混雜模式
第二步: 配置IP地址和網關
1、使用ficonfig命令查看系統當前的配置和網絡接口信息.
2、配置要使用的網口,這里是eth0
root@kali:/etc/network# vim interfaces
文本信息如下:
# 自動啟動eth0 auto eth0 # 設置eth0使用靜態地址 iface eth0 inet static # 設置eth0的ip地址 address 192.168.0.107 # 設置默認網關 gateway 192.168.0.1 # 設置eth0的子網掩碼 netmask 255.255.255.0
第三步:添加DNS
root@kali:~# vim /etc/resolv.conf # Generated by NetworkManager domain nameserver 192.168.0.1 nameserver 8.8.8.8 nameserver 114.114.114.114 nameserver 223.5.5.5 search localdomain
第四步 重新啟動網卡
root@kali:~# /etc/init.d/networking restart Restarting networking (via systemctl): networking.service.
但是這里重啟網卡后eth0 的IP並沒有更改過來,再次使用ifdown eth0; ifup eth0后,IP地址才刷新過來