欢迎来到天天文库
浏览记录
ID:32573091
大小:83.50 KB
页数:7页
时间:2019-02-12
《基于linux的家用网关》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、基于linux的家用网关准备工作:1.linux-2.6.9.tar.gz-----linux内核源代码2.busybox-1.10.1.tar.gz-----busybox是很多标准Linux®工具的一个单个可执行实现。3.实验环境虚拟机实验步骤:一、制作RAM盘映像文件(/root)1.创建空白文件系统ddif=/dev/zeroof=initrdbs=16Mcount=12.格式化空白文件系统mke2fs-F-m0initrd3.挂载mount-text2-oloopinitrd/mnt/initrd4.创建必要的目录(/mnt/initrd)脚本:insta
2、ll-d{bin,dev,etc,lib,mnt}install-d{sbin,usr,var,sys,proc}install-droot-m0750install-dtmp/var/tmp-m1777install-dusr/{bin,lib,sbin,share}install-dusr/share/terminfoinstall-dvar/{lock,log,run,lib,local,tmp}5.创建初始设备节点(/mnt/initrd/dev)脚本:mknod-m622consolec51mknod-m660nullc13chownroot:root*c
3、hmod+xMAKEDEV./MAKEDEV6.复制所需要的动态连接库(/mnt/initrd/lib/)cp-rdf/lib/libc-*.*.*.so./cp-rdf/lib/libc.so.6./cp-rdf/lib/ld-*.*.*.so./cp-rdf/lib/ld-linux.so.2./cp-rdf/lib/libcrypt-*.*.*.so./cp-rdf/lib/libcrypt.so.1./cp-rdf/lib/libnss_*./cp-rdf/lib/libresolv*./cp-rdf/lib/libdl*./cp-rdf/lib/libns
4、l*./cp/lib/libm.so.6./cp/lib/libselinux.so.1./cp–R/lib/tls/./cp-R/lib/iptables/./检查:(查看一是否有红名的文件)7.创建配置文件(当前目录/mnt/initrd/etc)fstab[root@localhostetc]#catfstab/dev/ram/rootfsdefaults11Proc/procprocdefaults00inittab[root@localhostetc]#chmod+xinittab[root@localhostetc]#catinittabconsole:
5、:sysinit:-/etc/rcStty0::askfirst:-/bin/login#ttyS0::respanwn:-/bin/ash::respawn:/sbin/getty-LttyS09600vt100::ctrlaltdel:/sbin/reboot::shutdown:/bin/umount-a-r::shutdown:/sbin/swapoff-arcS[root@localhostetc]#chmod+xrcS[root@localhostetc]#catrcShostnameGWmount-tproc/proc/procmount-tsysfs
6、/sys/sysmount-tdevptsdevpts/dev/ptsmount-ttmpfs/dev/shm/dev/shmudevd--daemonudevstart/sbin/klogd/sbin/syslogd/sbin/runcfgtelnetd-p10023nsswitch.conf[root@localhostetc]#catnsswitch.confpasswd:filesgroup:filesshadow:fileshosts:filesdnsnetworks:filesdnsprotocols:filesservices:filesethers:
7、filesrpc:filesnetgroup:filespasswd[root@localhostetc]#catpasswdroot:x:0:0:root:/:/bin/ashnobody:x:99:99:Nobody:/:/sbin/nologingroup[root@localhostetc]#catgrouproot:x:0:rootnobody:x:99:shadow[root@localhostetc]#catshadowroot:$1$FIC8K/qi$enuz4oqXR2FkjRgpcmU76.:13870:0:99999:7:::其他配置文件直
此文档下载收益归作者所有