Network Instructions in Linux
I will gradually learn some instructions about Network in Linux.
First, here are somethings about IPv4:
There are A, B, C, D, E, 5 classes.

(images copied from here)
And Sub-net mask for each is :
- A : 255.0.0.0
- B : 255.255.0.0
- C : 255.255.255.0
P.S.
- 127.x.x.x is loopback IP for your local host.
- D is remained for multi-cast
- E is remained for future applications
- the first IP in one class belongs to the network itself.E.g. 192.168.1.0 is a network IP
- the last IP in one class is a broadcast IP, packets sended to which will be sended to all hosts in the corresponding network.
ifconfig & iwconfig
- See IP, MAC address and network mask
ifconfig
- Modify IP
ifconfig eth0 192.168.1.104
- Activate/Shutdown Interface
ifconfig etho up/down
- Configure network mask
ifconfig eth0 netmask 255.255.255.0
- Change mode of Wireless network card
iwconfig wlan0 mode managed/monitor
nslookup
query Internet name servers
E.g.
nslookup www.baidu.com
netstat
See current ports' states
netstat -tunl
- t: means TCP
- u: means UDP
- n: Show numerical addresses instead of trying to determine symbolic host, port or user names.
- l: Show only listening sockets
netstat -an
- a: all
ping
ping hostname,
if the host you ping is down, your ping will return:

If the host you ping ignores your ICMP packet, the ping will continue:

Avoid ping by others:
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all
If you want to be ping:
echo 0 > /proc/sys/net/ipv4/icmp_echo_ignore_all
tcpdump
Use eth0 (-i) and ip/port (-nn means not use domain/service format) to monitor port 21 in hex (-X):
tcpdump -i eth0 -nnX port 21
P.S.
ftp and telnet use plain text to transport information and you can use tcpdump to monitor it directly.
(Also, you should use ssh to replace telnet !)
nmap
traceroute
- traceroute www.baidu.com
print the route packets trace to network host
telnet
You can use telnet to test whether a specific port in target host is open:
telnet 192.168.1.103 21
If it is open:

Or it will be:

ssh & scp
ssh username@IP
E.g.
First, switch on the sshd servie in the virtual environment:
service sshd start
In the host:
ssh root@192.168.1.123

Use scp to copy files:
scp [-r] username@IP:file-path local-path
scp [-r] local-path username@IP:file-path


iptables
Network Instructions in Linux的更多相关文章
- Prometheus Node_exporter 之 Network Netstat TCP Linux MIPs
Network Netstat TCP Linux MIPs1. TCP Aborts / Tiemouts type: GraphUnit: shortLabel: ConnectionsTCPAb ...
- linux 下使用 tc 模拟网络延迟和丢包-使用 linux 模拟广域网延迟 - Emulating wide area network delays with Linux
tc 是linux 内置的命令:使用man pages 查看 我们看到,其功能为 show / manipulate traffic control settings,可对操作系统进行流量控制: ne ...
- ubuntu 配置 samba, win7 map network device from linux
一. samba的安装: # sudo apt-get insall samba # sudo apt-get install smbfs 二. 创建共享目录,或是找已经存在的文件夹,只要权限放开就行 ...
- linux 网络虚拟化: network namespace 简介
linux 网络虚拟化: network namespace 简介 network namespace 是实现网络虚拟化的重要功能,它能创建多个隔离的网络空间,它们有独自的网络栈信息.不管是虚拟机还是 ...
- Bridge (br0) Network on Linux
动手实践虚拟网络 - 每天5分钟玩转 OpenStack(10) - CloudMan - 博客园https://www.cnblogs.com/CloudMan6/p/5296573.html li ...
- Linux network 资料链接
1.iptables 基础 https://wiki.centos.org/HowTos/Network/IPTables 2.HOWTOs on netfilter site http://www. ...
- Linux下的hosts文件和network文件区别
Linux下的hosts文件和network文件区别 Linux下有两种与计算机名相关的配置文件 1.hosts文件,路径:/etc/hosts,此文间是在网络上使用的, 用于解析计算机名 ...
- Linux tgtadm: Setup iSCSI Target ( SAN )
Linux target framework (tgt) aims to simplify various SCSI target driver (iSCSI, Fibre Channel, SRP, ...
- Linux 下虚拟机——Virtual Box
下面介绍几款可以在Linux下运行的虚拟机 VMware,VirtualBox, QEMU, Xen.(其中我只用过VirtualBox 和Xen, 我是新手,其他两个没时间折腾,所以下面的资料都几乎 ...
随机推荐
- Croppic – 免费开源的 jQuery 图片裁剪插件
Croppic 这款开源的 jQuery 图片裁剪插件能够满足网站开发人员各种不同的使用需要.只需要简单的上传图片,就可以实现你想要的图像缩放和裁剪功能.因为使用了 HTML5 FormData 对 ...
- jQuery仿京东无限级菜单HoverTree
官方网址:http://keleyi.com/jq/hovertree/ 效果图: 看了上面效果图,你或许已经明白为什么是仿京东菜单.如果还不明白,请访问http://list.jd.com/list ...
- Spring AOP专业术语解析
一. 连接点(Joinpoint) 连接点就是程序执行的某个特定的位置,如:类开始初始化前.类初始化后.类的某个方法调用前.类的某个方法调用后.方法抛出异常后等.Spring 只支持类的方法前.后.抛 ...
- SQLServer表内自关联级联删除
今天处理SQLServer级联删除遇到了很蛋疼的事. SQLServer 不支持表内自关联级联删除,而MySql和Oracle却支持. 貌似原因是SQLServer 会产生循环级联,就不给这样弄.所以 ...
- ReactNative ScrollView或ListView头部莫名其妙多了20px
之前在还没有加TabBarIOS时,ScrollView一直是好好的,然后随着深入,需要做其他tab页面的时候问题来了,当我把首页加入TabBarIOS.Item时..我首页中的ScrollView头 ...
- datagridview的数据存取
这里主要是复习DataSet等数据或ADO.NET方面的知识.下面是一个简单的数据存储(在DataGridView上增加一行然后并存储到数据库的过程): private void button1_Cl ...
- SharePoint 2013 配置HTTPS(SSL)
1.打开服务器上的IIS,找到服务器证书,如下图: 2.进入服务器证书,点击右侧操作“创建自签名证书”,如下图: 3.为证书指定一个好记名称,存储选择个人,如下图: 4.点击确定以后,服务器证书页面, ...
- Autodesk的照片建模云服务—Autodesk ReCap 360 photo 的测试数据
之前已经给大家介绍过了Autodesk的照片建模云服务—Autodesk ReCap 360 photo, 你也可以自己登录到http://recap360.autodesk.com/ 自己试一试. ...
- Kotlin语法(类和对象)
二.类和对象: 1. 类定义: 类的声明包含类名,类头(指定类型参数,主构造函数等等),以及类主体,用大括号包裹.类头和类体是可选的:如果没有类体可以省略大括号. class Invoice{ } 2 ...
- 自定义View之onMeasure()
1.自定义View之onMeasure() 2.onMeasure实例分析