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, 我是新手,其他两个没时间折腾,所以下面的资料都几乎 ...
随机推荐
- jQuery Tocify 定位导航
Tocify是一个jQuery插件,能够动态的生成文章目录,Tocify可以随意的设置Twitter Bootstrap 或者 jQueryUI Themeroller支持的可选动画和jQuery的显 ...
- 让你忘记 Flash 的15款精彩 HTML5 游戏
HTML5 游戏开发是一个热门的话题,开发人员和设计人员最近经常谈论到.虽然不能迅速取代 Flash 的地位,但是 HTML5 凭借它的开放性和强大的编程能力,取代 Flash 是必然的趋势.你会看到 ...
- Ubuntu 各版本代号简介
起名字是件伤脑筋的事,但是程序猿们似乎最喜欢干伤脑筋的活.Android 的每个版本都有个甜点的别名,而 Ubuntu ,每个版本都有一个更为特色的名字,这个名字由一个形容词和一个动物名称组成,并且, ...
- CSS常见兼容性问题
DOCTYPE 影响 CSS 处理 Firefox: div 设置 margin-left, margin-right 为 auto 时已经居中, IE 不行 Firefox: body 设置 tex ...
- ReactNative ScrollView或ListView头部莫名其妙多了20px
之前在还没有加TabBarIOS时,ScrollView一直是好好的,然后随着深入,需要做其他tab页面的时候问题来了,当我把首页加入TabBarIOS.Item时..我首页中的ScrollView头 ...
- Java解析Soap XML
package com.jstrd.tipstock.webservice.jt.base; import java.io.ByteArrayInputStream; import java.util ...
- 使用fastboot工具刷入recovery.img、boot.img、system.img等
在Android SDK目录的platform-tools目录下有fastboot.exe刷机工具(注:需要将机器进入fastboo模式) 刷recovery.img: fastboot flash ...
- iOS定时器、延迟执行
1.通用方式(并不是实时调用并且会卡顿): // 一般用于更新一些非界面上的数据 [NSTimer scheduledTimerWithTimeInterval:时间间隔 target:self se ...
- IOS客户端Coding项目记录导航
IOS客户端Coding项目记录(一) a:UITextField设置出现清除按键 b:绘画一条下划线 表格一些设置 c:可以定义表头跟底部视图(代码接上面) d:隐藏本页的导航栏 e:UIEdge ...
- Play Framework安装和配置
安装环境: jdk 1.7; play 1.3.1; eclipse 安装指南:http://play-framework.herokuapp.com/zh/install 安装Play Framew ...