Kali Linux Task 5

连祈
2022-04-23 / 0 评论 / 14 阅读 / 正在检测是否收录...
温馨提示:
本文最后更新于2022年04月23日,已超过1092天没有更新,若内容或图片失效,请留言反馈。

Kali Linux 定制化

网络配置


临时指定IP
手动联系dhcp服务器重新获取
dhclient eth0

手动指定IP地址
ifconfig eth0 192.168.1.11/24

指定网关,指定路由(缺省路由),使得机器能通过网关访问其他网段的电脑
route add default gw 192.168.1.1
default 指代默认。 gw 指代网关
确认设置是否生效
netstat -nr
route -n(和上面那条命令等价)

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 eth0    (默认路由)
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0

默认路由为 目标网络和子网掩码都是0.0.0.0的那条信息

route add -net 172.16.0.0/24 gw 192.168.1.100 eth0
-net代表添加网段
gw 参数指定网关
eth0 指定该路由使用哪块网卡通信

配置DNS服务器
即配置  /etc/resolv.conf 文件
echo nameserver 8.8.8.8 >> /etc/resolv.conf


长期生效
通过编辑网卡的配置文件
/etc/network/interfaces  (不同Linux发行版位置不同)

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback
#iface eth0 inet dhcp 
#dhcp动态获取ip
iface eth0 inet static
adress 192.168.0.1
netmask 255.255.255.0
gateway 192.168.0.254
#以上是必须要配置的
#以下可选
network 192.168.20.0 
#网络地址
broadcast 192.168.20.255
#广播地址
dns-nameservers 192.168.1.1 192.168.1.2 
#dns服务器配置也可在网卡配置文件中加入
up route add -net 172.16.5.0/24 gw 192.168.10.100 eth1
#up指:在网卡启动后,向系统添加这样一条路由配置
#内部网段,静态路由配置
down route del -net 172.24.0.0/24
#删除路由配置
#down指:在网卡关闭后,向系统删除这样一条路由配置

升级更新
apt-get update
更新的是哪些软件包可以更新的索引文件
apt-get upgrade
真正的更新软件包
apt-get dist-upgrade
debian有大版本升级时进行更新

更换更新源
/etc/apt/sources.list
在网上寻找更新源

 

0

评论 (0)

取消