|

楼主 |
发表于 2003-12-7 21:51:13
|
显示全部楼层
感谢tram:)
搞定了,只是elinks或w3m中不能登陆www.linuxsir.cn
我都装zhcon了,显示中文也正常,不明白!
刚才总结了一下:
事先声明我的情况是两块网卡,第一块不用eth0,使用第二块eth1上网。
IP地址 192.168.41.41
子网掩码255.255.255.0
网关 192.168.41.48
启用DNS 192.168.41.48
下面没有的文件就建立,参数一定要根据自己的实际情况写。
编辑这个文件/etc/sysconfig/network
HOSTNAME=lfs
GATEWAY=192.168.41.48
GATEWAY_IF=eth1
编辑这个文件/etc/hosts
# Begin /etc/hosts (network card version)
127.0.0.1 lfs localhost
# End /etc/hosts (network card version)
编辑这个文件/etc/sysconfig/network-devices/ifconfig.eth1
ONBOOT=yes
IP=192.168.41.41
NETMASK=255.255.255.0
BROADCAST=192.168.41.255
编辑这个文件/etc/resolv.conf
nameserver 192.168.41.48
最后运行这三条命令
ifconfig eth0 down
ifconfig eth1 up
/etc/rc.d/init.d/network restart
一定要ping 192.168.41.48通网关。
ifconfig(我机器上的供参考)
eth1 Link encap:Ethernet HWaddr 00:E0:4C:39:50:04
inet addr:192.168.41.41 Bcast:192.168.41.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:28 errors:0 dropped:0 overruns:0 frame:0
TX packets:13 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:3160 (3.0 Kb) TX bytes:1195 (1.1 Kb)
Interrupt:11 Base address:0x1000
lo Link encap ocal Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
netstat -rn(我机器上的供参考)
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.41.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
0.0.0.0 192.168.41.48 0.0.0.0 UG 0 0 0 eth1 |
|