|
激活网卡 service network start|stop
ifdown eth0
ifup tth0
ifconfig eth0 up|down
/etc/init.d/network中
#/etc/sysconfig/network-scripts/ifcfg-eth0:
DEVICE=eth0
BOOTPROTO=static
BROADCAST=192.168.1.255
IPADDR=192.168.1.10
NETMASK=255.255.255.0
NETWORK=192.168.1.0
HWADDR=52:54:AB:2F:CF:F0
GATEWAY=192.168.1.1
ONBOOT=on
TYPE=Ethernet
#/etc/resolv.conf
nameserver 202.109.14.5
nameserver 202.96.209.5
search localdomain
或者使用命令:setup
或者:
route add -net 192.168.1.50 netmask 255.255.255.0 dev eth0
或:
ifconfig eth0 192.168.1.50 netmask 255.255.255.0
ubuntu 网卡设置,ip,mask,gateway,dns
sudo vi /etc/network/interfaces
//这个应该是决定是否启用这个端口
auto eth0
//静态设置IP
iface eth0 inet static
address 172.16.146.200
netmask 255.255.255.0
#broadcast 172.16.146.255
gateway 172.16.146.254
//通过dhcp动态设置
iface eth0 inet dhcp
//设置DNS服务器
sudo vi /etc/resolv.conf
nameserver 202.96.128.68
nameserver 61.144.56.101
nameserver 192.168.8.220
//重新设置网络,以启用新设置
sudo /etc/init.d/networking restart
//ok
/etc/modules.conf
例如,我们有两块ISA总线的3c509卡,一个IO地址是0x300,另一个是0x320。编辑“modules.conf”文件如下:
alias eth0 3c509 (驱动)
alias eth1 3c509
options 3c509 io=0x300,0x320(以IO参数装载)
配置
ifconfig 查看网络状态=windows中的ipconfig
[root @stationxx root]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:E0:4C:E3:21:F4 (mak地址)
inet addr:192.168.0.152{ip} Bcast:192.168.0.255(gataway)
Mask:255.255.255.0{子网掩码}
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:49299 errors:0 dropped:0 overruns:0 frame:0
TX packets:3710 errors:0 dropped:0 overruns:0 carrier:0
collisions:101 txqueuelen:100
RX bytes:4051762 (3.8 Mb) TX bytes:394174 (384.9 Kb)
Interrupt:5 Base address:0x7000
netconfig
neat{图形界面}
cat /etc/sysconfig/network-scripts
DEVICE=eth0(网络设备 )
ONBOOT=yes{开机是否被激活}
BOOTPROTO=static/nonr{静态}或dhcp/dhpd(同dhcp协议不同)
IPADDR=192.168.1.168
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
USERCTL=yes 是否允许普通用户配置
|