免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 10062 | 回复: 17
打印 上一主题 下一主题

网络为LAN,ping外网IP都是NO ROUTE TO HOST?(已解决) [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-03-07 17:02 |只看该作者 |倒序浏览
网络为局域网,路由器IP 192.168.1.1 PING 192.168.1.1通,ping局域网其它IP也通,但是PING外网IP都是NO ROUTE TO HOST,该如何设置呢?尝试运行 route add -net 0.0.0.0/0 192.168.1.1 后可以ping通外网IP,但是在x中还是不可以上网,重启后也要重复添加一次才ping的通外网IP。
运行 route add default 192.168.1.1 显示为存在,FreeBSD版本为5.3.

路由表如下:
Routing tables

Internet:
Destination Gateway Flags Refs Use Netif Expire
default 192.168.1.1 UGS 0 49 rl0
127.0.0.1 127.0.0.1 UH 0 426 lo0
192.168.1 link#1 UC 0 0 rl0
192.168.1.1 00:d0:59:43:9c:c5 UHLW 1 13 rl0 1195
192.168.1.11 00:e0:4c:f5:2b:04 UHLW 0 7 rl0 837
192.168.1.200 00:e0:4c:69:37:76 UHLW 0 888 lo0

Internet6:
Destination Gateway Flags Netif Expire
::1 ::1 UH lo0
fe80::%rl0/64 link#1 UC rl0
fe80::2e0:4cff:fe69:3776%rl0 00:e0:4c:69:37:76 UHL lo0
fe80::%lo0/64 fe80::1%lo0 U lo0
fe80::1%lo0 link#3 UHL lo0
ff01::/32 ::1 U lo0
ff02::%rl0/32 link#1 UC rl0
ff02::%lo0/32 ::1 UC lo0

192。168。1。200 是安装了FREEBSD的IP。

同网段内的其他机器是win系统,可以通过这个网关上网。安装FreeBSD时为默认安装,应该没防火墙的吧。已经一星期了,急死了,在rh下什么都不用设就可以上网了,难道bsd真的那么麻烦?

论坛徽章:
0
2 [报告]
发表于 2005-03-07 17:09 |只看该作者

网络为LAN,ping外网IP都是NO ROUTE TO HOST?(已解决)

我的rc.conf
# -- sysinstall generated deltas -- # Thu Mar  3 17:29:22 2005
# Created: Thu Mar  3 17:29:22 2005
# Enable network daemons for user convenience.
# Please make all changes to this file, not to /etc/defaults/rc.conf.
# This file now contains just the overrides from /etc/defaults/rc.conf.
apm_enable="YES"
gateway_enable="YES"
sendmail_enable="YES"
sendmail_flags="-bd"
sendmail_msp_queue_enable="NO"
sendmail_outbound_enable="NO"
sendmail_submit_enable="NO"
usbd_enable="YES"
# This file now contains just the overrides from /etc/defaults/rc.conf.
# Please make all changes to this file, not to /etc/defaults/rc.conf.

# Enable network daemons for user convenience.
# Created: Fri Mar  4 02:39:38 2005
# This file now contains just the overrides from /etc/defaults/rc.conf.
# Please make all changes to this file, not to /etc/defaults/rc.conf.

# Enable network daemons for user convenience.
# Created: Fri Mar  4 02:39:43 2005
# This file now contains just the overrides from /etc/defaults/rc.conf.
# Please make all changes to this file, not to /etc/defaults/rc.conf.

# Enable network daemons for user convenience.
# Created: Fri Mar  4 02:50:21 2005
# This file now contains just the overrides from /etc/defaults/rc.conf.
# Please make all changes to this file, not to /etc/defaults/rc.conf.

# Enable network daemons for user convenience.
# Created: Fri Mar  4 03:04:49 2005
# This file now contains just the overrides from /etc/defaults/rc.conf.
# Please make all changes to this file, not to /etc/defaults/rc.conf.

# Enable network daemons for user convenience.
# Created: Thu Mar  3 11:41:42 2005
# -- sysinstall generated deltas -- # Thu Mar  3 11:41:42 2005
moused_port="/dev/mse0"
moused_type="logitech"
moused_enable="YES"
# This file now contains just the overrides from /etc/defaults/rc.conf.
# Please make all changes to this file, not to /etc/defaults/rc.conf.

# Enable network daemons for user convenience.
# Created: Fri Mar  4 09:38:19 2005
# -- sysinstall generated deltas -- # Fri Mar  4 09:38:19 2005
ifconfig_rl0="inet 192.168.1.200  netmask 255.255.255.0"
sendmail_enable="YES"
tcp_extensions="YES"
hostname="localhost.localhost"
# This file now contains just the overrides from /etc/defaults/rc.conf.
# Please make all changes to this file, not to /etc/defaults/rc.conf.

# Enable network daemons for user convenience.
# Created: Fri Mar  4 11:15:38 2005
# -- sysinstall generated deltas -- # Fri Mar  4 11:15:38 2005
linux_enable="YES"
accounting_enable="NO"
moused_enable="YES"
nis_client_enable="NO"
rpcbind_enable="YES"
mountd_flags="-n"
amd_enable="YES"
rwhod_enable="NO"
named_enable="NO"
tcp_extensions="YES"
hostname="localhost.localhost"
# This file now contains just the overrides from /etc/defaults/rc.conf.
# Please make all changes to this file, not to /etc/defaults/rc.conf.

# Enable network daemons for user convenience.
# Created: Fri Mar  4 11:41:21 2005
# -- sysinstall generated deltas -- # Fri Mar  4 11:41:21 2005
hostname="localhost.localhost        "
# This file now contains just the overrides from /etc/defaults/rc.conf.
# Please make all changes to this file, not to /etc/defaults/rc.conf.

# Enable network daemons for user convenience.
# Created: Fri Mar  4 11:42:02 2005
# -- sysinstall generated deltas -- # Fri Mar  4 11:42:02 2005
hostname="localhost.localhost        "
# This file now contains just the overrides from /etc/defaults/rc.conf.
# Please make all changes to this file, not to /etc/defaults/rc.conf.

# Enable network daemons for user convenience.
# Created: Fri Mar  4 13:04:43 2005
# -- sysinstall generated deltas -- # Fri Mar  4 13:04:43 2005
moused_type="auto"
moused_enable="YES"
# This file now contains just the overrides from /etc/defaults/rc.conf.
# Please make all changes to this file, not to /etc/defaults/rc.conf.

# Enable network daemons for user convenience.
# Created: Fri Mar  4 13:29:44 2005
# This file now contains just the overrides from /etc/defaults/rc.conf.
# Please make all changes to this file, not to /etc/defaults/rc.conf.

# Enable network daemons for user convenience.
# Created: Fri Mar  4 16:43:13 2005
# -- sysinstall generated deltas -- # Fri Mar  4 16:43:13 2005
hostname="localhost.localhost        "
# This file now contains just the overrides from /etc/defaults/rc.conf.
# Please make all changes to this file, not to /etc/defaults/rc.conf.

# Enable network daemons for user convenience.
# Created: Mon Mar  7 11:33:09 2005
# -- sysinstall generated deltas -- # Mon Mar  7 11:33:09 2005
gateway_enable="NO"
tcp_extensions="YES"
# This file now contains just the overrides from /etc/defaults/rc.conf.
# Please make all changes to this file, not to /etc/defaults/rc.conf.

# Enable network daemons for user convenience.
# Created: Mon Mar  7 11:33:38 2005
# -- sysinstall generated deltas -- # Mon Mar  7 11:33:38 2005
gateway_enable="YES"
# This file now contains just the overrides from /etc/defaults/rc.conf.
# Please make all changes to this file, not to /etc/defaults/rc.conf.

# Enable network daemons for user convenience.
# Created: Mon Mar  7 12:49:37 2005
# -- sysinstall generated deltas -- # Mon Mar  7 12:49:37 2005
moused_type="auto"
moused_enable="NO"
# This file now contains just the overrides from /etc/defaults/rc.conf.
# Please make all changes to this file, not to /etc/defaults/rc.conf.

# Enable network daemons for user convenience.
# Created: Mon Mar  7 13:25:39 2005
# This file now contains just the overrides from /etc/defaults/rc.conf.
# Please make all changes to this file, not to /etc/defaults/rc.conf.

# Enable network daemons for user convenience.
# Created: Mon Mar  7 13:41:09 2005
# This file now contains just the overrides from /etc/defaults/rc.conf.
# Please make all changes to this file, not to /etc/defaults/rc.conf.

# Enable network daemons for user convenience.
# Created: Mon Mar  7 15:29:57 2005
# -- sysinstall generated deltas -- # Mon Mar  7 15:29:57 2005
hostname="localhost.localhost        "

论坛徽章:
0
3 [报告]
发表于 2005-03-07 21:14 |只看该作者

网络为LAN,ping外网IP都是NO ROUTE TO HOST?(已解决)

DefaultRouter=???

论坛徽章:
0
4 [报告]
发表于 2005-03-07 21:21 |只看该作者

网络为LAN,ping外网IP都是NO ROUTE TO HOST?(已解决)

route add default 192.168.1.1 显示已经存在。

论坛徽章:
0
5 [报告]
发表于 2005-03-07 21:24 |只看该作者

网络为LAN,ping外网IP都是NO ROUTE TO HOST?(已解决)

你要rc.conf里面添加

论坛徽章:
0
6 [报告]
发表于 2005-03-07 21:25 |只看该作者

网络为LAN,ping外网IP都是NO ROUTE TO HOST?(已解决)

[quote]原帖由 "liudengme"]你要rc.conf里面添加[/quote 发表:
格式为…………?

论坛徽章:
0
7 [报告]
发表于 2005-03-07 21:28 |只看该作者

网络为LAN,ping外网IP都是NO ROUTE TO HOST?(已解决)

你把你那个rc.conf编辑一下,把有#号的行全部删掉
添加DefaultRouter=192.168.1.1

论坛徽章:
0
8 [报告]
发表于 2005-03-07 21:31 |只看该作者

网络为LAN,ping外网IP都是NO ROUTE TO HOST?(已解决)

原帖由 "liudengme" 发表:
你把你那个rc.conf编辑一下,把有#号的行全部删掉
添加DefaultRouter=192.168.1.1
其实带 # 号的删除不删除没所谓的吧,那些都是注释掉的。我明天试试。那部电脑在办公室呢。谢谢你。

论坛徽章:
0
9 [报告]
发表于 2005-03-07 21:35 |只看该作者

网络为LAN,ping外网IP都是NO ROUTE TO HOST?(已解决)

你看起来头不疼吗:)

论坛徽章:
0
10 [报告]
发表于 2005-03-07 21:36 |只看该作者

网络为LAN,ping外网IP都是NO ROUTE TO HOST?(已解决)

我在Freebsdchina好像也发过这问题,
在/etc/rc.conf 加

  1. defaultrouter="192.168.1.1"  
复制代码

也是不行。ping 202.96.134.134 还是不通,这个IP是深圳电信得DNS。
不过但是没用运行 route add -net 0.0.0.0/0 192.168.1.1来Ping 202.96.134.134。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP