局域网上网终极解决之道

由 Freebird 在 04-05-2003 10:01 发表:

局域网上网终极解决之道

在局域网内如何上网曾困恼我许久,为次我发此帖,希望对大家有点帮助。以我自己为例。我是通过学校里的局域网上网的。我的IP为202.101.247.15.(eth0)。首选DNS:202.101.224.68,备用DNS:202.101.226.68。下面为具体步骤:

1.激活使用的网络接口:ifconfig eth0 202.101.247.15 netmask 255.255.255.0 up

2.设置域名服务器(DNS):这要修改/etc/resolv.conf文件。假设我的主机名为 www.freebird.com (随意的)。那么resolv.conf文件如下:

domain freebird.com

nameserver 202.101.224.68

nameserver 202.101.226.68

3.设置本地主机文件/etc/hosts为:

127.0.0.1 localhost (必不可少的)

202.101.247.15 www.freebird.com freebird

当然你还可以在此加入其他网址和它IP来加快连线的速度。

4.设置路由(最关键的一步):即添加路由和默认的网关,命令如下:

route add -net 202.101.247.0 netmask 255.255.255.0 eth0

route add default gw 202.101.247.15 eth0

如果你想在每次开机后就能上网,那么你要把第4步中的命令写入/etc/rc.local文件中。如果这样还连不上,你就要在设置好这些后,在“网络”中手动激活你的网卡。

我用此法N次,均成功,祝你好运


爱生活,爱拉登。

小站才刚完成,呵呵

http://finalbsd.go.3322.org/


由 tianhen 在 04-30-2003 21:10 发表:

但我不知道主机怎么办?

但我不知道主机怎么办?比如我也是校园网。IP:10.10.0.6

掩码是:255.255.255.0 网关:10.10.0.254 DSN:211.95.193.97

该怎么设置哦??


由 Snoopy 在 05-01-2003 00:03 发表:


/etc/sysconfig/network-scripts/ifcfg-eth0


And then in the evening light, when the bars of freedom fall

I watch the two of you in the shadows on the wall

How in the darkness steals some of the choices from my hand

Then will I begin to under


由 float 在 09-13-2003 13:01 发表:

:(

我按照你的方法设置.

但无法看网页,而nslookup则可以使用,正向和反向解释都成功.

真是奇怪.


由 叉子 在 09-16-2003 15:18 发表:


你好,我用ipconfig eth0 命令 显示没有找到eth0这个设备,是怎么回事?

昨天用KDE界面上的network选项设好了的,可以上网了,但今天就不行了。

RH8 REALTEK RTL8139 上的是联通的宽带局域网。


由 Freebird 在 09-16-2003 19:59 发表:


应该是ifconfig eth0

是不是eth0视情况而定,用ifconfig -a看看,一般如果只有一块网卡应该就是eth0了


爱生活,爱拉登。

小站才刚完成,呵呵

http://finalbsd.go.3322.org/


由 shiquan 在 09-16-2003 20:16 发表:

这个是透明代理吗?

如果我的局域网里的机器没有正式的ip地址,能用这种方法让他们都上的了网吗?


认真、沉着的我喜欢认真沉着的她。


由 叉子 在 09-17-2003 16:19 发表:

回复bird

都在这呢

~>ifconfig -a

lo Link encap:Local Loopback

inet addr:127.0.0.1 Mask:255.0.0.0

UP LOOPBACK RUNNING MTU:16436 Metric:1

RX packets:72 errors:0 dropped:0 overruns:0 frame:0

TX packets:72 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:0

RX bytes:4682 (4.5 Kb) TX bytes:4682 (4.5 Kb)

~>>ifconfig eth0

eth0: error fetching interface information: Device not found

~>

"dmesg"

ohci1394: pci_module_init failed

ip_tables: (C) 2000-2002 Netfilter core team

8139cp 10/100 PCI Ethernet driver v0.0.7 (Feb 27, 2002)

8139cp: pci dev 03:05.0 (id 10ec:8139 rev 10) is not an 8139C+ compatible chip

8139cp: Try the "8139too" driver instead.

PCI: Found IRQ 12 for device 00:1f.5

PCI: Sharing IRQ 12 with 00:1f.3

PCI: Sharing IRQ 12 with 03:05.0

PCI: Setting latency timer of device 00:1f.5 to 64

intel8x0: clocking to 48000

Linux agpgart interface v0.99 (c) Jeff Hartmann

Windows 98 IP Configuration

Host Name . . . . . . . . . : LUCK

DNS Servers . . . . . . . . : 211.90.8.129

211.94.33.193

Node Type . . . . . . . . . : Broadcast

NetBIOS Scope ID. . . . . . :

IP Routing Enabled. . . . . : No

WINS Proxy Enabled. . . . . : No

NetBIOS Resolution Uses DNS : No

0 Ethernet adapter :

Description . . . . . . . . : PPP Adapter.

Physical Address. . . . . . : 44-45-53-54-00-00

DHCP Enabled. . . . . . . . : Yes

IP Address. . . . . . . . . : 0.0.0.0

Subnet Mask . . . . . . . . : 0.0.0.0

Default Gateway . . . . . . :

DHCP Server . . . . . . . . : 255.255.255.255

Primary WINS Server . . . . :

Secondary WINS Server . . . :

Lease Obtained. . . . . . . :

Lease Expires . . . . . . . :

1 Ethernet adapter :

Description . . . . . . . . : Realtek 8139-series PCI NIC

Physical Address. . . . . . : 00-E0-4C-8D-8B-B6

DHCP Enabled. . . . . . . . : Yes

IP Address. . . . . . . . . : 192.168.1.112

Subnet Mask . . . . . . .

Published At
Categories with 服务器类
Tagged with
comments powered by Disqus