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的更多相关文章

  1. Prometheus Node_exporter 之 Network Netstat TCP Linux MIPs

    Network Netstat TCP Linux MIPs1. TCP Aborts / Tiemouts type: GraphUnit: shortLabel: ConnectionsTCPAb ...

  2. linux 下使用 tc 模拟网络延迟和丢包-使用 linux 模拟广域网延迟 - Emulating wide area network delays with Linux

    tc 是linux 内置的命令:使用man pages 查看 我们看到,其功能为 show / manipulate traffic control settings,可对操作系统进行流量控制: ne ...

  3. ubuntu 配置 samba, win7 map network device from linux

    一. samba的安装: # sudo apt-get insall samba # sudo apt-get install smbfs 二. 创建共享目录,或是找已经存在的文件夹,只要权限放开就行 ...

  4. linux 网络虚拟化: network namespace 简介

    linux 网络虚拟化: network namespace 简介 network namespace 是实现网络虚拟化的重要功能,它能创建多个隔离的网络空间,它们有独自的网络栈信息.不管是虚拟机还是 ...

  5. Bridge (br0) Network on Linux

    动手实践虚拟网络 - 每天5分钟玩转 OpenStack(10) - CloudMan - 博客园https://www.cnblogs.com/CloudMan6/p/5296573.html li ...

  6. Linux network 资料链接

    1.iptables 基础 https://wiki.centos.org/HowTos/Network/IPTables 2.HOWTOs on netfilter site http://www. ...

  7. Linux下的hosts文件和network文件区别

    Linux下的hosts文件和network文件区别   Linux下有两种与计算机名相关的配置文件     1.hosts文件,路径:/etc/hosts,此文间是在网络上使用的, 用于解析计算机名 ...

  8. Linux tgtadm: Setup iSCSI Target ( SAN )

    Linux target framework (tgt) aims to simplify various SCSI target driver (iSCSI, Fibre Channel, SRP, ...

  9. Linux 下虚拟机——Virtual Box

    下面介绍几款可以在Linux下运行的虚拟机 VMware,VirtualBox, QEMU, Xen.(其中我只用过VirtualBox 和Xen, 我是新手,其他两个没时间折腾,所以下面的资料都几乎 ...

随机推荐

  1. Sortable – 简单灵活的 JavaScript 拖放排序插件

    当需要在网站中添加拖放排序功能的时候,jQuery UI 的排序组件可能是最流行的解决方案.今天给大家介绍另一款简单灵活的 JavaScript 拖放排序插件——Sortable,它使用 HTML5 ...

  2. 8款适合乐队、歌手和音乐家免费 WordPress 主题

    这篇文章与大家分享8款适合乐队.歌手和音乐家免费 WordPress WordPress 音乐网站主题.WordPress 作为最流行的博客系统,插件众多,易于扩充功能.安装和使用都非常方便,而且有许 ...

  3. 用js动态生成css代码

    有时候我们需要利用js来动态生成页面上style标签中的css代码,方法很直接,就是直接创建一个style元素,然后设置style元素里面的css代码,最后把它插入到head元素中.但有些兼容性问题我 ...

  4. about this

    var name="window name"; var obj={ name:"obj name", getNameFunc:function(){ //thi ...

  5. [deviceone开发]-优惠券商户管理端App开源

    一.简介 这是一个优惠券的商主端,也就是配置发送优惠券的App 页面和交互还是像纳豆那样非常漂亮流畅,大家可以参考一下 二.效果图 三.源码分享 https://github.com/do-proje ...

  6. ionic rang在弹出modal中不可拖拽的问题

  7. Web UI - Javascript之DOM Ready

    最近终于稍微适应了工作环境,终于可以让自己缓口气.于是决定要写点东西,算是督促.记录和提升自己的学习.代码的世界,你不轮它,以后就会被它轮.这个系列尽量保持在一周或两周更一篇,目标是在创造内容的时候更 ...

  8. SharePoint 2013 – Workflow Manager 1.0 offline download

    [http://sharepointdeal.wordpress.com/2013/03/13/sharepoint-2013-workflow-manager-1-0-offline-downloa ...

  9. listview复用机制研究

    Listview在第一次的时候会先把屏幕上绘制的item都new出来,为了讲解方便我把new出来的item都用红色背景,复用的则用绿色背景. 可以看到这个list种有三种item.在第一次展示的时候, ...

  10. Windows下修改Android手机的hosts

    Windows下修改Android手机的hosts 1.首先,手机是Root过的. 2.连接手机和电脑, adb shell 进入命令行. 3.获取root用户权限: su -root 4.不知道为何 ...