Linux 基础命令知识4
来源:互联网 发布:怎么做淘宝装修 编辑:程序博客网 时间:2024/05/18 14:14
打印网络接口列表
ifconfig | cut -c-10 | tr -d ' ' | tr -s '\n'
eth0
lo
#cut -c-10 只取前10个字符 , tr -d '' 删除所有的空格 tr -s '\n' 合并换行符
ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:0c:29:8c:ff:7a
inet addr:192.168.164.140 Bcast:192.168.164.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe8c:ff7a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4410 errors:5 dropped:7 overruns:0 frame:0
TX packets:3018 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4268650 (4.2 MB) TX bytes:260426 (260.4 KB)
Interrupt:19 Base address:0x2000
#Hwaddr 为硬地址(Mac地址)
#inet addr : IP地址
#Bcast :广播地址
#Mask : 子网掩码
#设置网络接口Ip地址
sudo ifconfig eth0 192.168.164.142
#设置子网掩码
sudo ifconfig eth0 netmask 225.225.225.0
#设置硬件地址 ,在做MAC地址欺骗的时候可能会用上
sudo ifconfig eth0 hw ether 00:1c:bf:87:25:d5
DNS查找
#利用host 命令 或者 nslookup命令对域名进行解析
host www.baidu.com
www.baidu.com is an alias for www.a.shifen.com.
www.a.shifen.com has address 119.75.217.109
www.a.shifen.com has address 119.75.218.70
nslookup www.baidu.com
Server: 127.0.0.1
Address: 127.0.0.1#53
Non-authoritative answer:
www.baidu.com canonical name = www.a.shifen.com.
Name: www.a.shifen.com
Address: 119.75.217.109
Name: www.a.shifen.com
Address: 119.75.218.70
查看路由表
route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.164.0 * 255.255.255.0 U 0 0 0 eth0
#或者 -n选项用于展示数字形式地址
route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0 0
- Linux 基础命令知识4
- Linux 基础命令知识1
- Linux 基础命令知识2
- Linux 基础命令知识3
- Linux基础命令知识大全
- linux基础命令和知识(一)
- linux基础命令和知识(二)
- linux基础命令和知识(三)
- linux系统基础命令和知识总结
- linux基础命令4
- Linux命令知识总结
- Linux命令小知识
- 【Linux 基础】入门知识
- Linux基础网络知识
- 【Linux 基础】入门知识
- linux基础小知识
- mongodb基础命令和知识
- Linux命令基础4-cat命令
- LeetCode-Happy Number-解题报告
- IOS--UI--LessonGestureRecoginer 手势
- 13-多线程
- squid反向代理加密网页
- WPS2013版(V9版)二次开发所遇问题及解决方法小结
- Linux 基础命令知识4
- 7-8工作日志
- 华为测试--简单密码破解
- nginx 配置从零开始
- iOS动画入门
- uvalive 6902 Three Squares - dfs
- 类彩票选号算法
- Squid 搭建正向代理详细解释
- Launcher3添加左屏及去除全部应用列表界面