ipset
推荐用 hash:net,不要用 hash:ip。后者会在添加网段时转为添加网段里每一个ip。
ipset create cn hash:net
ipset add cn 114.114.114.114
ipset add cn 115.190.0.0/15
ipset create macbl hash:mac
Network scan
apt install nmap
# ping scan
nmap -sP -PI 192.168.1.0/24
- -sP : This option tells Nmap to only perform a ping scan (host discovery), then print out the available hosts that responded to the scan. This is also known as ping scan.
- -PI : This open tells Nmap that we are sending ICMP echo requests
禁用 IPV6
Preferring IPv4 over IPV6 addresses
vi /etc/gai.conf
Uncomment the last below lines:
# For sites which use site-local IPv4 addresses behind NAT there is
# the problem that even if IPv4 addresses are preferred they do not
# have the same scope and are therefore not sorted first. To change
# this use only these rules:
#
scopev4 ::ffff:169.254.0.0/112 2
scopev4 ::ffff:127.0.0.0/104 2
scopev4 ::ffff:0.0.0.0/96 14