首页 > linux 怎么设置网络?

linux 怎么设置网络?

今天在以前的电脑上安装了一个“centos 5.4” 用光盘安装的
没有安装界面程序只是安装了其中的server部分本来想用于学习服务器的设置和部署。但是搞了很久没有搞出来。
问题是我怎么通过全命令行的方式来设置网络,让我可以链接互联网,并且工作在局域网中。有用过的吗?怎么设置呢?谢谢分享!
ps: # netstat -nr
打印出来的消息中:destination gateway genmask flags mss window irtt iface 都没有值


如果是centos的话 有个简单的方法
使用命令 setup 你再一级一级的找网卡配置填写配置就可以了
另外了解关于网卡的配置文件位置
/etc/sysconfig/network-script/ifcfg-eth0 / ifcfg-eth1


Another way, write the following commands in your .bashrc file or any script which will run after OS bootup or user login:

ifconfig eth0 192.168.1.2 netmask 255.255.255.0 up

Then check the route info, with the command:

route -n

Make sure the gateway is set correctly.
Also not forget check the dns configure in the file /etc/resol.conf.

【热门文章】
【热门文章】