kali Linux 网络配置

it2023-07-27  67

# dhcp自动获取 dhclient eth0 # 指定IP(当前可用) ifconfig eth0 192.168.1.11/24 # 指定路由和网关(当前可用) route add default gw 192.168.1.1 # 添加自定义路由和网关,以及指定网卡 route add -net 172.16.0.0/24 gw 192.168.1.100 eth0 # 查看路由表 route -n # 查看 netstat -nr # 追加DNS服务器地址 echo nameserver 114.114.114.114 >> /etc/resolv.conf # 网卡配置文件 /etc/network/interfaces auto eth0 # 静态设置 iface eth0 inet static address 192.168.20.1 netmask 255.255.255.0 network 192.168.20.0 broadcast 192.168.20.255 gateway 192.168.20.2 dns-nameservers 192.168.1.1 192.168.1.2 up route add-net 172.16.5.0/24 gw 192.168.10.100 eth1 down route del-net 172.4.0.0/24
最新回复(0)