ubuntu 网络配置

Wesley13
• 阅读 559

修改ip:

vi /etc/network/interfaces

auto eth0

iface eth0 inet static

address 192.168.1.120

netmask 255.255.255.0

gateway 192.168.1.1

修改dns:

vi /etc/resolvconf/resolv.conf.d/base (长期)

vi /etc/resolv.conf (临时)

nameserver 114.114.114.114

摘:http://blog.sina.com.cn/s/blog_67be3b450101de44.html

# The loopback network interface

auto lo

iface lo inet loopback

# The primary network interface

auto eth0

iface eth0 inet static

address xxx.xxx.xxx.xxx

netmask xxx.xxx.xxx.xxx

gateway xxx.xxx.xxx.xxx

auto eth0:0

iface eth0:0 inet static

address xxx.xxx.xxx.xxx

netmask xxx.xxx.xxx.xxx

#dns-nameservers 202.102.224.68 202.102.227.68

up route add -net xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx gw xxx.xxx.xxx.xxx eth0

up route add -net xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx gw xxx.xxx.xxx.xxx eth0

up route add -net xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx gw xxx.xxx.xxx.xxx eth0

点赞
收藏
评论区
推荐文章
Wesley13 Wesley13
2年前
mysql忘记root用户密码找回步骤
修改或找回root密码步骤1.修改MySQL的登录设置:vi/etc/my.cnf在mysqld的段中加上一句:skipgranttables保存并且退出vi。2.重新启动mysqld/etc/init.d/mysqldrestart(servicemysqldrestar
Wesley13 Wesley13
2年前
mysql设置远程访问
(1)连接数据库mysqlurootp(2)输入密码(3)切换数据库usemysql;(4)修改root用户hostupdateusersethost'%'whereuser'root';(5)修改mysqld配置文件vi/etc/mysql/mysql.co
Stella981 Stella981
2年前
CentOS 6.x 网卡配置
1)编辑配置文件,添加修改以下内容\vi /etc/sysconfig/networkscripts/ifcfgeth0  BOOTPROTOstatic  启用静态IP地址ONBOOTyes 开启自动启用网络连接IPADDR192.168.21.129 设置IP地址NETMASK255.255
Wesley13 Wesley13
2年前
vsftpd FTP服务器
1.安装vsftp【yumyinstallvsftpd】  2.配置vsftpd配置文件vsftpd.conf在/etc/vsftpd中,配置vsftpd.conf。【vi/etc/vsftpd/vsftpd.conf】1)修改不允许匿名登录   为 2)修改日志文件路径设置 为 3)修改
Wesley13 Wesley13
2年前
CDN+集中存储环境搭建
一、cdn部署环境:CentOS6master:172.16.17.1slave\_telcom:172.16.17.2slave\_unicom:172.16.17.31.主服务器配置172.16.17.1修改主配置文件:vi/etc/named.confoptions{    
Wesley13 Wesley13
2年前
Ubuntu安装NGINX+PHP
禁止IP6协议vi/etc/modprobe.d/blacklist.conf底部追加blacklistipv6修改软件仓库源mv/etc/apt/sources.list/etc/apt/sources.list.bakvi/etc/apt/sources.listUbuntu14
Stella981 Stella981
2年前
CentOS6.5 永久修改主机名
1、编辑/etc/sysconfig/network文件vi/etc/sysconfig/networkNETWORKINGyesHOSTNAMEtest012、修改 /etc/hosts文件root@localhost~vim/etc/hosts127.0.0.1
Wesley13 Wesley13
2年前
Ubuntu配置NTP
1、安装 aptgetinstallntp2、修改ntp.conf配置文件vi/etc/ntp.conf添加以下行server120.24.166.46(阿里云NTPServer)restrict192.168.1.0mask255.255.255.0nomodifyrestrict
Stella981 Stella981
2年前
CentOS6安装Xmanager远程桌面
CentOS6配置:安装gdm(若已安装则不需安装)yumyinstallgdm配置系统为图形模式,打开/etc/inittab,修改为id:5:initdefault:(若已为5则不需修改)vi/etc/inittab打开/etc/gdm/custom.conf,在\security\和\xdmcp\字段下分别
Stella981 Stella981
2年前
Linux终端中文输出
1、修改配置文件:/etc/sysconfig/i18n,若该文件不存在,则vi创建该文件即可:vi  /etc/sysconfig/i18nLANG"en\_US.UTF8"              英文格式LANG"zh\_CN.UTF8"