LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 2856|回复: 2

ubuntu 下如何添加网卡(三张,有两张一样,只能认出两张不同的)

[复制链接]
发表于 2005-4-13 16:15:56 | 显示全部楼层 |阅读模式
我的系统是ubuntu horry 本来机子上有两张网卡,最近需要添加一张网卡,配置dmz防火墙,插上去后找不到网卡,到网上找了很久没解决。望高手赐教,呵呵。
我的网卡是两张via_rhine 和一张relteck8139,目前一张via_rhine认不出来,
听说要在模块加载的地方加载两次,我在etc下找了很久,找不到在哪个配置文件下加载的,呵呵。
发表于 2005-4-14 11:36:27 | 显示全部楼层
我用的和兄弟的版本不一样,网卡也只能用一个。我用的是powerpc版本。大体上应该差不多。。

要看一下这个几个文件:我也不太熟悉 。

/etc/modules  这里也启动时自动加载的模块
/etc/modprobe.d/aliases 为设备指定别名,我认为应该是这里 比如加个  


  1. alias eth0  via-rhine
  2. alias eth1 via-rhine
复制代码


最好先用ifconfig来查一下,不要把8139的写错了。到底8139是eth0还是eth1,还是eth2。。

/etc/modprobe.d/arch-aliases  这个也看一下吧。。
modprobe.d  
另外网卡ip的配置文件是
/etc/network/interfaces

如果是DHCP自动获得IP,内容是:




  1. # This file describes the network interfaces available on your system
  2. # and how to activate them. For more information, see interfaces(5).

  3. # The loopback network interface
  4. auto lo
  5. iface lo inet loopback

  6. # This is a list of hotpluggable network interfaces.
  7. # They will be activated automatically by the hotplug subsystem.
  8. mapping hotplug
  9.         script grep
  10.         map eth0

  11. # The primary network interface
  12. iface eth0 inet dhcp

  13. auto eth0
复制代码


如果是自己指定的IP,interface的内容格式如下:


  1. # This file describes the network interfaces available on your system
  2. # and how to activate them. For more information, see interfaces(5).

  3. # The loopback network interface
  4. auto lo
  5. iface lo inet loopback

  6. # This is a list of hotpluggable network interfaces.
  7. # They will be activated automatically by the hotplug subsystem.
  8. mapping hotplug
  9.         script grep
  10.         map eth0

  11. # The primary network interface
  12. iface eth0 inet static
  13. address 192.168.1.2
  14. netmask 255.255.255.0
  15. gateway 192.168.1.1

  16. auto eth0

复制代码


感觉和其它linux版本差不多,大同小异。。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-1-11 12:37:41 | 显示全部楼层
呵呵,当时的水平还看不懂。后来插了网卡重装系统。
今天又碰到这个问题,现在看看还不错。
不过现在已经用udev了,没这么麻烦了。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表