侧边栏壁纸
博主头像
落叶人生博主等级

走进秋风,寻找秋天的落叶

  • 累计撰写 130562 篇文章
  • 累计创建 28 个标签
  • 累计收到 9 条评论
标签搜索

目 录CONTENT

文章目录

ping ,ifconfig ..简单的网络命令

2023-12-20 星期三 / 0 评论 / 0 点赞 / 128 阅读 / 2199 字

网络: ifconfig:查看网卡相关信息 ifconfig eth0 up|down ifconfig eth0:1 192.168.1.100 ip addr 配置文件:/etc/sysc

网络:
ifconfig:查看网卡相关信息
    ifconfig eth0 up|down
    ifconfig eth0:1 192.168.1.100
    ip addr

    配置文件:/etc/sysconfig/network-scripts/ifcfg-eth0

ONBOOT=yes 设置为开机启动哦
route:查看路由表
    route -n
    route -add host|net
    route -del host|net


netstat:查看网络相关的详细信息
    netstat -anutlp|grep :22
    查看22号端口相关的网络信息
    netstat -anutlp|grep sshd
    查看进程名为sshd相关网络信息
    netstat -anutlp |grep 11112(PID)
    查看进程号为11112的网络相关信息

    通过进程号找到执行程序路径,有两种方式。
    lsof -p pid
    ll /proc/pid
arp:查看本机上的arp列表
    arp -a
    arp -s
    arp -d

arping:ping的时候显示MAC地址


nmap:扫描工具
    1) 获取远程主机的系统类型及开放端口

    nmap -sS -P0 -sV -O <target>

    2)在网络寻找所有在线主机

    nmap -sP 192.168.0.*
    
    3)显示目标主机的TCP
    nmap -sT 127.0.0.1

    4)显示目标主机UDP
    nmap -sU 127.0.0.1

ping:测试网络联通性
    ping -c
    ping -s


traceroute:测试到目标主机所经过的跳数(hops)
        traceroute -m
        traceroute -w
        traceroute -q
        traceroute -n

广告 广告

评论区