一、环境:
2台linux:redhat 9
1台XP
二、实验过程
eth0 192.168.0.1 接交换机与内网相连
eth1 192.168.0.100 连接modem 通过adsl拨号
route内容为:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
202.103.29.218 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 202.103.29.218 0.0.0.0 UG 0 0 0 ppp0
另一台linux 一块网卡
eth0 192.168.0.111 网关设为192.168.0.1
查看route信息:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
可见缺省路由是指向0.1的
在这台机上启动转发:
原来XP的客户机指向0.1上网,现在在0.111上启用了转发,可以把XP的网关指向0.111
在XP上追踪,当指向0.111时信息如下:
Tracing route to ns.wuhan.net.cn [202.103.24.68]
over a maximum of 30 hops:
1 <1 ms <1 ms <1 ms 192.168.0.111
2 <1 ms <1 ms <1 ms 192.168.0.100
3 * * * Request timed out.
4 22 ms 21 ms 21 ms 221.232.250.9
…
8 22 ms 21 ms 22 ms ns.wuhan.net.cn [202.103.24.68]
原来指向0.1时信息如下:
Tracing route to ns.wuhan.net.cn [202.103.24.68]
over a maximum of 30 hops:
1 <1 ms <1 ms <1 ms 192.168.0.100
2 * * * Request timed out.
3 21 ms 20 ms 21 ms 221.232.250.9
…
7 21 ms 22 ms 21 ms ns.wuhan.net.cn [202.103.24.68]
可以现在多了0.111这一跳.
在111的机器上再加一个网络的ip
eth0:0 192.168.1.112
此时111的route信息如下
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.0.1 0.0.0.0 UG 1 0 0 eth0
XP的网关设为0.111,是ping不通另一个子网的1.112的。
再次启用转发:
这样XP将网关设为0.111之后,既可以上外网,也可以访问另一个子网了。
引导文件:
LILO /etc/lilo.conf
GRUB /boot/grub/menu.lst
1,系统启动文件核脚本
主启动控制文件 /etc/inittab
SysV启动脚本的位置 /etc/init.d、/etc/rc.d/init.d或/etc/rc.d
SysV启动脚本链接的位置 /etc/init.d/rc?.d、/etc/rc.d/rc?.d或/etc/rc?.d
本地启动脚本 /etc/rc.d/rc.local、/etc/init.d/boot.local或/etc/rc.boot里的文件
2,网络配置文件
建立网络接口的脚本 /sbin/ifup
保存网络配置数据文件的目录 /etc/network、/etc/sysconfig/network和/etc/sysconfig/network-scripts
保存解析DNS服务的文件 /etc/resolv.conf
DHCP客户端的配置文件 /etc/dhclient.conf
3,超级服务程序配置文件和目录
inetd配置文件 /etc/inetd.conf
TCP Wrappers配置文件 /etc/hosts.allow和/etc/hosts.deny
xinetd配置文件 /etc/xinetd.conf和/etc/xinetd.d目录里的文件
4,硬件配置
内核模块配置文件 /etc/modules.conf
5,硬件访问文件
Linux设备文件 /dev目录里
保存硬件和驱动程序数据的文件 /proc目录里
6,扫描仪配置文件
SANE主配置 /etc/sane.d/dll.conf
特定扫描仪的配置文件 /etc/sane.d目录里以扫描仪型号命名的文件
7,打印机配置文件
BSD LPD核LPRng的本地打印机主配置文件 /etc/printcap
CUPS本地打印机主配置和远程访问受权文件 /etc/cups/cupsd.conf
BSD LPD远程访问受权文件 /etc/hosts.lpd
LPRng远程访问受权文件 /etc/lpd.perms
8,文件系统
文件系统表 /etc/fstab
软驱装配点 /floppy、/mnt/floppy或/media/floppy
光驱装配点 /cdrom、/mnt/cdrom或/media/cdrom
9,shell配置文件
bash系统非登录配置文件 /etc/bashrc、/etc/bash.bashrc或/etc/bash.bashrc.local
bash系统登录文件 /etc/profile和/etc/profile.d里的文件
bash用户非登录配置文件 ~/.bashrc
bash用户登录配置文件 ~/.profile
10,XFree86配置文件核目录
XFree86主配置文件 /etc/XF86config、/etc/X11/XF86Config或/etc/X11/XF86Config-4
字体服务程序配置文件 /etc/X11/fs/config
Xft 1.x配置文件 /etcX11/XftConfig
Xft 2.0配置文件 /etc/fonts/fonts.conf
字体目录 /usr/X11R6/lib/X11/fonts和/usr/share/fonts
11,Web服务程序配置文件
Apache主配置文件 /etc/apache、/etc/httpd或/httpd/conf里的httpd.conf或httpd2.conf文件
MIME类型文件 与Apache主配置文件在同一目录里的mime.types或apache-mime.types
12,文件服务程序配置文件
ProFTPd配置文件 /etc/proftpd.conf
vsftpd配置文件 /etc/vsftpd.conf
NFS服务程序的输出定义文件 /etc/exports
首先,可用w命令查看登录用户信息,例如:
16:15:11 up 210 days, 12:17, 2 users, load average: 0.13, 0.15, 0.10
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
liu pts/1 IPADDRESS 16:14 0.00s 0.04s 0.03s sshd: liu [priv]
fmd001_c pts/2 IPADDRESS 16:13 52.00s 0.03s 0.02s sshd: fmd001_cleaning [priv]
强制踢人命令格式:pkill -kill -t tty
解释:
pkill -kill -t 踢人命令
tty 所踢用户的TTY
如上踢出liu用户的命令为:
注意:只有root用户才能踢人,而且两个root可以互踢,哈哈。