debian下修改IP地址

我的是神州数码的,不过规格应该都是一样 的,即 DFE-530TX ,网卡模块名称 via-rhine 。
一般内核都有把这个驱动做成模块。

装etch的时候,也没有认出我的网卡,但没有关系,安装好基本系统后,可以先加载这个模块:
#modprobe via-rhine
这个只是手动加载一下模块,看看是否能够成功。如果能够成功,并且lspci也能够看到网卡信息。
这样就可以把加载模块写入 /etc/modules.conf 里,就不需要每次都运行modprobe via-rhine了。
运行

#lspci
……
0000:00:0a.0 Ethernet controller: Accton Technology Corporation EN-1216 Ethernet Adapter (rev 11)
……
 

应该可以看到相关的网卡信息。

我是手动更改了一下 /etc/modules.conf 文件,把网卡的加载模块写进去。

alias eth0 via-rhine
 

然后设置一下网卡,如下面的是设置动态获取IP,编辑文件 /etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
#这里设置为动态IP
iface eth0 inet dhcp
 

当然也可以设置为静态IP地址,如:
在 /etc/network/interfaces 中,删除 iface eth0 inet dhcp,添加一下内容

iface eth0 inet static
address 192.168.0.13
netmask 255.255.255.0
broadcast 192.168.0.255
network 192.168.0.0
gateway 192.168.0.159
 


重启网络
#/etc/init.d/networking restart 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值