Linux 版 (精华区)
作 家: topcon (南方) on board 'unix'
题 目: 用linux做router & dns server.
来 源: 哈尔滨紫丁香站
日 期: Thu Oct 10 17:33:37 1996
出 处: jqc@pclinux.hit.edu.cn
本人使用LINUX 作了一个Router和DNS Server,使用linux的routed daemon,未使用arp
一切正常,我上BBS即是通过linux作的路由。以下是相应文件内容:
1。/etc/lilo.conf
# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
boot = /dev/hda
#compact # faster, but won't work on all systems.
# delay = 5
vga = normal # force sane state
ramdisk = 0 # paranoia setting
# End LILO global section
# Linux bootable partition config begins
image = /zImage
root = /dev/hda1
label = linux-gw
read-only # Non-UMSDOS filesystems should be mounted read-only for checking
append = "ether=0,0,eth1"
# Linux bootable partition config ends
2. /etc/rc.d/rc.inet1
# Edit for your setup.
IPADDR="202.118.66.3" # REPLACE with YOUR IP address!
IPADDR1="202.118.65.1"
NETMASK="255.255.255.0" # REPLACE with YOUR netmask!
NETWORK="202.118.66.0" # REPLACE with YOUR network address!
NETWORK1="202.118.65.0"
BROADCAST="202.118.66.255" # REPLACE with YOUR broadcast address, if you
# have one. If not, leave blank and edit below.
BROADCAST1="202.118.65.255"
GATEWAY="202.118.66.1" # REPLACE with YOUR gateway address!
# Uncomment ONLY ONE of the three lines below. If one doesn't work, try again.
# /sbin/ifconfig eth0 ${IPADDR} netmask ${NETMASK} broadcast ${BROADCAST}
/sbin/ifconfig eth0 ${IPADDR} broadcast ${BROADCAST} netmask ${NETMASK}
/sbin/ifconfig eth1 ${IPADDR1} broadcast ${BROADCAST1} netmask ${NETMASK}
# /sbin/ifconfig eth0 ${IPADDR} netmask ${NETMASK}
# Uncomment these to set up your IP routing table.
/sbin/route add -net ${NETWORK} netmask ${NETMASK}
/sbin/route add -net ${NETWORK1} netmask ${NETMASK}
/sbin/route add default gw ${GATEWAY} metric 1
3. /etc/rc.d/rc.inet2
# # Start the ROUTEd server.
if [ -f ${NET}/routed ]; then
echo -n " routed"
${NET}/routed -g -s
fi
--
※ 来源:·哈尔滨紫丁香站 bbs1.hit.edu.cn·[FROM: jqc@pclinux.hit.edu.]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:2.880毫秒