两种方法配置网络
一
1,启动网卡
ifconfig eth0 up
2,获取ip
dhcpcd eth0
3,查看网卡
ifconfig
二
1.查看下可用的网卡
ifconfig -a
2.配置/etc/rc.conf
interface=eth0
eth0="dhcp"
lo="lo 127.0.0.1"
eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255"
#eth0 IP netmask 子网掩码 broadcast 广播
(根据自己的情况来定)
INTERFACES=(eth0)
gateway="default gw 192.168.0.1"
#gateway 网关
ROUTES=(gateway)
3.配置/etc/reslov.conf
nameserver 61.128.128.68
nameserver 61.128.192.68
(根据自己的情况来定)
4.重启网络
/etc/rc.d/network restart