1 / 23

本章重点内容

本章重点内容. Linux 静态路由器 网络测试方法和测试工具 Linux 网络应用. 本章学习目标. 掌握 Linux 静态路由器的配置 学会使用配置和检测网络的相关命令 学会使用常用的网络客户工具. Linux 内核路由表. 查看 Linux 内核路由选择表 # route. 三种路由类型. 主机路由 Destination Gateway Genmask Flags Metric Ref Use Iface -----------------------------------------------------------------------

isaura
Télécharger la présentation

本章重点内容

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 本章重点内容 Linux静态路由器 网络测试方法和测试工具 Linux网络应用

  2. 本章学习目标 掌握Linux静态路由器的配置 学会使用配置和检测网络的相关命令 学会使用常用的网络客户工具

  3. Linux内核路由表 查看Linux内核路由选择表 # route

  4. 三种路由类型 主机路由 Destination Gateway Genmask Flags Metric Ref Use Iface ----------------------------------------------------------------------- 10.0.0.10 192.168.1.1 255.255.255.255 UGH 0 0 0 eth0 网络路由 Destination Gateway Genmask Flags Metric Ref Use Iface -------------------------------------------------------------------- 192.19.12 192.168.1.1 255.255.255.0 UGN 0 0 0 eth0 默认路由 Destination Gateway Genmask Flags Metric Ref Use Iface --------------------------------------------------------------------- default 192.168.1.1 0.0.0.0 UG 0 0 0 eth0

  5. 使用route命令设置静态路由 route命令格式 # route [add|del] [-net|-host] target [netmask Nm] [gw Gw] [[dev] If]

  6. route命令设置静态路由 route命令举例 添加到主机的路由 # route add -host 192.168.1.2 dev eth0:0 # route add -host 10.20.30.148 gw 10.20.30.40 添加到网络的路由 # route add -net 10.20.30.40 netmask 255.255.255.248 eth0 # route add -net 10.20.30.48 netmask 255.255.255.248 gw 10.20.30.41 # route add –net 192.168.1.0/24 eth1

  7. route命令设置静态路由 route命令举例 删除路由 # route del -host 192.168.1.2 dev eth0 # route del -host 10.20.30.148 gw 10.20.30.40 # route del -net 10.20.30.40 netmask 255.255.255.248 eth0 # route del -net 10.20.30.48 netmask 255.255.255.248 gw 10.20.30.41 # route del -net 192.168.1.0/24 eth1 # route del default gw 192.168.1.1

  8. 设置包转发 使用如下的命令查看当前系统是否支持包转发。 # sysctl net.ipv4.ip_forward 使用如下的命令配置包转发 # sysctl -w net.ipv4.ip_forward=1 为在启动计算机时启用包转发,需要将下面的行写入配置文件/etc/sysctl.conf。 net.ipv4.ip_forward = 1

  9. 静态路由设置举例

  10. 静态路由设置举例

  11. 静态路由设置举例 已建立的路由表

  12. 网络测试工具的使用(1) 检测网络接口 # ifconfig 检测网络连通性 # ping www.sina.com.cn # ping -c 4 192.168.1.12 显示路由表 # route 检测到目的主机所经过的路由器 # traceroute www.sina.com.cn

  13. 网络测试工具的使用(2) 功能:显示网络连接、路由表和网络接口信息 显示网络接口状态信息 # netstat -i 显示内核路由表信息 # netstat -r 显示TCP/UDP传输协议的连接状态 # netstat -t # netstat -u

  14. 网络测试工具的使用(3) 检测DNS服务器是否正常工作 # nslookup //“>”是nslookup命令环境的提示符 //输入待查询的域名“www.redhat.com” > www.redhat.com > exit //使用exit命令退出nslookup命令环境

  15. 网络测试一般方法 排除非自身因素 查看本机IP地址 检测与网关的连接 监测与互联网的连接 测试域名解析 测试与特定站点的连接

  16. Linux网络应用简介(1) Linux下的服务器 Web服务:Apache Mail服务:Sendmail、Postfix、Qmail、Exim/Cyrus IMAP、Courier IMAP DNS服务:BIND FTP服务:Vsftpd、Wu-ftpd、Proftpd、pure-ftpd 代理服务:Squid 目录服务:OpenLDAP 文件服务:Samba、NFS 数据库服务:Oracle、Sybase、DB2、PostgreSQL、MySQL、FireBird 远程管理:VNC、Webmin、SSH

  17. Linux网络应用简介(2) Linux下的网络客户工具 图形界面浏览器:Firefox、Mozilla 字符界面浏览器:elinks、lynx、w3m 图形界面E-mail客户端:Thunderbird、Evolution 字符界面E-mail客户端:Mutt、Gnus、Elm、Emacs 图形界面FTP客户端:Gftp、Konqueror 字符界面FTP客户端:lftp、Ncftp、ftp 图形界面下载工具:WebDownloader for X、Httrack、Getleft 字符界面下载工具:wget、lftp、Curl

  18. lftp简介 lftp是个功能强大的字符界面文档传输工具。 功能 支持ftp、ftps、http、https、hftp、fish等传输协议 支持FXP(在两个FTP服务器之间传输文件) 支持代理 支持多线程传输 支持传输队列(queue) 支持镜像(mirror) 支持书签 类似bash,提供后台命令、nohop模式、命令历史、命令别名、命令补齐和作业控制支持。

  19. lftp简介 lftp是个功能强大的字符界面文档传输工具。 功能 支持ftp、ftps、http、https、hftp、fish等传输协议 支持FXP(在两个FTP服务器之间传输文件) 支持代理 支持多线程传输 支持传输队列(queue) 支持镜像(mirror) 支持书签 类似bash,提供后台命令、nohop模式、命令历史、命令别名、命令补齐和作业控制支持。

  20. 安装使用lftp 安装 # wget \ http://dl.atrpms.net/production/packages/redhat-9-i386/atrpms/lftp-3.1.1-21.rh9.at.i386.rpm # rpm -Uvh lftp-3.1.1-21.rh9.at.i386.rpm

  21. 安装使用lftp lftp命令的格式 $ lftp [-p <port>] [-u <user>[,<pass>]] [<site>] -p <port>:用于指定连接的端口 -u <user>[,<pass>]:使用指定的用户名/口令进行FTP身份验证 <site>:指定主机名、URL或书签名

  22. lftp的子命令(1) ftp客户的通用子命令 帮助子命令:? 调用shell:! <shell-command> FTP连接管理子命令:open、close 远程目录管理子命令:pwd、ls、cd、mkdir、rmdir 本地目录管理子命令:lcd 远程权限管理子命令:chmod 上传下载子命令:get、mget、put、mput 退出子命令:bye、quit

  23. wget简介 wget使用HTTP和FTP这两个使用最广泛的Internet协议,支持代理服务器和断点续传, 是基于console控制台最强大的下载工具。 功能 不使用交互界面的wget可以在后台工作。 在wget通过FTP下载时,具有文件名通配符匹配和目录递归镜像功能。 wget可以读出并储存HTTP和FTP站点给出的时间戳,从而可以判断远程文件的更新状况。 断点续传的功能使得wget在缓慢和不稳定的连接状态下表现依然出色。 支持代理服务器的特性使得wget在使用中减小网络负载、加速下载以及配合防火墙使用成为可能。 支持被动FTP下载。

More Related