免费注册 查看新帖 |

Chinaunix

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

[网络管理] 网络设置求助 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-07-28 09:50 |只看该作者 |倒序浏览
笔记本上同时安装了XP和Debian 4,网络结构是ADSL(常在线,设置为自动拨号,带路由功能,分配192.168.1.2-192.168.1.10给子网)和5口switch连接。

在XP下设置IP 192.168.1.2,网关192.168.1.1就能正常上网,可是在Debian下这样设置就不能上网,不仅ping不通外网,连192.168.1.1都ping不通。

ifconfig结果:
eth1      Link encap:Ethernet  HWaddr 00:03:9D:75:93:B8  
          inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::203:9dff:fe75:93b8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:92 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interrupt:11 Base address:0xa000

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:194 errors:0 dropped:0 overruns:0 frame:0
          TX packets:194 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:37040 (36.1 KiB)  TX bytes:37040 (36.1 KiB)

iptables -L结果:
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

route结果:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
localnet        *               255.255.255.0   U     0      0        0 eth1
default         192.168.1.1     0.0.0.0         UG    0      0        0 eth1


谁能告诉我应该怎么办啊?谢谢了!

论坛徽章:
5
IT运维版块每日发帖之星
日期:2015-08-06 06:20:00IT运维版块每日发帖之星
日期:2015-08-10 06:20:00IT运维版块每日发帖之星
日期:2015-08-23 06:20:00IT运维版块每日发帖之星
日期:2015-08-24 06:20:00IT运维版块每日发帖之星
日期:2015-11-12 06:20:00
2 [报告]
发表于 2007-07-28 11:00 |只看该作者
加这个命令。
route add -net 192.168.1.0 dev eth0
如果语法有错误自己改一下。

论坛徽章:
0
3 [报告]
发表于 2007-07-28 11:26 |只看该作者
为什么你的第一个网卡是  eth1 呢。
ifconfig -a

论坛徽章:
0
4 [报告]
发表于 2007-07-28 14:51 |只看该作者
不是第一个网卡,eth0 没有用

论坛徽章:
0
5 [报告]
发表于 2007-07-28 14:56 |只看该作者

回复 #2 ssffzz1 的帖子

route add -net 192.168.1.0 dev eth0 执行错误。

执行了route add -net 192.168.1.0 netmask 255.255.255.0 dev eth1之后
route结果是:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
localnet        *                      255.255.255.0   U     0      0        0        eth1
localnet        *                      255.255.255.0   U     0      0        0        eth1  #增加了此行
default         192.168.1.1     0.0.0.0              UG    0      0        0        eth1

执行了route add -net 192.168.1.0 gw 192.168.1.1 netmask 255.255.255.0 dev eth1之后
route结果是:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
localnet        *                       255.255.255.0   U     0      0        0      eth1
localnet        192.168.1.1      255.255.255.0   U     0      0        0      eth1  #增加了此行
default         192.168.1.1      0.0.0.0              UG    0      0        0      eth1


问题依旧。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP