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, 我是新手,其他两个没时间折腾,所以下面的资料都几乎 ...
随机推荐
- [原][CSS3]会动的盒子机器人
[PC与移动端皆可]会动的盒子机器人 浏览器必须可以解析perspective属性. 在线:http://wangxinsheng.herokuapp.com/boxMan 代码: <!DOCT ...
- ABAP中RETURN与EXIT语句的区别
EXIT:1) EXIT如果出现在循环中,退出的是整个循环操作,.程序会从循环结束处开始继续执行,其作用相当于Java与C++中的break.2)EXIT如果出现在循环之外,退出的是当前执行的程序块( ...
- FeatureLayer,FeatureDataset,FeatureClass,Feature的概念
刚学AE,其中很多概念都模糊不清.经过一段时间的摸索总结,对FeatureLayer,FeatureDataset,FeatureClass,Feature几个概念有了一点认识.拿出来分享一下,有错误 ...
- Android 4.4沉浸式状态栏的实现
要实现Android 4.4上面的沉浸式状态栏要用到开源项目SystemBarTint(https://github.com/hexiaochun/SystemBarTint) public clas ...
- Provisioning Profile文件在哪找?
~/Library/MobileDevice/Provisioning Profiles
- 【代码笔记】iOS-根据size截取屏幕中间矩形区域
代码: RootViewController.m #import "RootViewController.h" @interface RootViewController () @ ...
- 网络热恋之SDWebImage
SDWebImage-master 是一个非常强大的三方. 当需要应用SDWeb时把文件夹里的SDWebImage文件夹放入工程里. 在需要使用网络获取图片的文件里进入头文件#import " ...
- (视频) 基于HTML5的服务器远程访问工具
现在云计算这么发达,基本上每个人都多少有几台Windows或者Linux服务器运行在云端,要直接进入这些服务器进行配置就需要使用类似远程桌面或者Putty这类的工具,虽然大多数Windows电脑都自带 ...
- Maven在Windows上的安装与配置
下载Maven 1.进入Maven官网下载:maven.apache.org(点击进入或复制浏览器地址栏,回车进入) 注意事项:需要大家要注意的是(截至目前2015年12月1日)最新版本的Maven3 ...
- Mongodb Manual阅读笔记:CH4 管理
4 管理 Mongodb Manual阅读笔记:CH2 Mongodb CRUD 操作Mongodb Manual阅读笔记:CH3 数据模型(Data Models)Mongodb Manual阅读笔 ...