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. windows 安装 go语言

    下载地址:http://www.cnblogs.com/osfipin/p/4856839.html. 官方教程说明: Windows 对于Windows用户,Go项目提供两种安装选项(从源码安装除外 ...

  2. ssh框架搭建的基本步骤(以及各部分作用)

    ssh框架搭建的基本步骤(以及各部分作用)     一.首先,明确spring,struts,hibernate在环境中各自的作用.   struts: 用来响应用户的action,对应到相应的类进行 ...

  3. DevExpress更新至13.1.7

    DevExpress下的.NET界面组件 DXperience Universal Suite 最新发布13.1.7版,多个属性的定义方式发生变化,另外还有大量的bug修复.使用DevExpress朋 ...

  4. Angular JS | Closure | Google Web Toolkit | Dart | Polymer 概要汇集

    AngularJS | Closure | Google Web Toolkit | Dart | Polymer GWT https://code.google.com/p/google-web-t ...

  5. Java Android HTTP实现总结

    Java Android HTTP实现总结 Http(Hypertext Transfer Protocol)超文本传输协议,是一个基于请求/响应模式的无状态的协议,Http1.1版给出了持续连接的机 ...

  6. iOS开发之多媒体API (转载)

    视频格式可以分为适合本地播放的本地影像视频和适合在网络中播放的网络流媒体影像视频两大类.尽管后者在播放的稳定性和播放画面质量上可能没有前者 优秀,但网络流媒体影像视频的广泛传播性使之正被广泛应用于视频 ...

  7. spring.net (1) 概念-控制反转(又名依赖注入)

    Spring.net 作为一个应用程序框架,在构建企业级.net应用程序提供了很多灵活而又丰富的功能(如:依赖注入,aop,数据访问抽象,asp.net 扩展). 控制反转: Inversion of ...

  8. XCode设置(怎么让代码收缩)

    有时候刚使用一台电脑 可能会没有代码收缩的功能. 在哪里设置呢?看图 打开xcode 的 偏好设置 找到textEditing 把Code folding勾选上 就可以了

  9. 安卓开发基础之tween动画基本使用,代码教学

    xml代码块: <?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:andro ...

  10. UIPickerView简单应用

    下面是一些效果图 下面是代码.有些枯燥 , 其实并不难 . #import <UIKit/UIKit.h> @interface ViewController : UIViewContro ...