搜索
macos - linux 怎么设置网络?
黄舟
黄舟 2017-04-17 10:59:42
[Linux讨论组]

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

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

全部回复(2)
迷茫

如果是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.

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号