Linux 最小化安装后IP的配置(手动获取静态IP地址)

一、图形化界面配置(假设为电脑A)

如果你的Linux安装有图形化界面,那么通过以下方式来配置:

我这里是有两块网卡,第一个网卡在上篇中已经通过DHCP来配置了:Linux 最小化安装后IP的配置(DHCP获取IP地址)

第一块王卡:

看一下配置2:

另外一块网卡打算使用手动获取

看一下配置1:

 二、如果你的Linux是最小安装请看下面的配置(电脑B)

也是两块网卡,第一块网卡同样是DHCP获取IP,在上篇中已经通过DHCP来配置了:Linux 最小化安装后IP的配置(DHCP获取IP地址)

打算第二块网卡手动配置IP

1.查看电脑上安装的网卡

nmcli connection show 

将在这个网卡上手动配置,查看该网卡的详细信息:

2.将ipv4的获取方式改为手动manual

nmcli connection modify Wired\ connection\ 1 ipv4.method manual

只有先将IP的获取方式改为手动后才可以手动分配IP,否则不能设置IP

3.修改IP的网关,地址,DNS

nmcli connection modify Wired\ connection\ 1 ipv4.addresses 196.168.1.2/24 ipv4.gateway 192.168.1.254 ipv4.dns 8.8.8.8

这句话相当于3句话(分别对地址,网关,DNS修改):

nmcli connection modify Wired\ connection\ 1 ipv4.addresses 196.168.1.2/24

nmcli connection modify Wired\ connection\ 1 ipv4.gateway 192.168.1.254

nmcli connection modify Wired\ connection\ 1 ipv4.dns 8.8.8.8

此处,还可以添加一个备用的dns:

nmcli connection modify Wired\ connection\ 1  +ipv4.dns 9.9.9.9

4.重启服务

systemctl restart network

5.激活网卡

ifconfig查看:

查看网卡信息:

nmcli connection show Wired\ connection\ 1 

可以看到已经成功

ping一下A电脑:

成功

版权

作者:feiquan

出处:http://www.cnblogs.com/feiquan/

版权声明:本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

大家写文都不容易,请尊重劳动成果~ 这里谢谢大家啦(*/ω\*)

原文地址:https://www.cnblogs.com/feiquan/p/9227106.html

时间: 2024-08-04 09:43:41

Linux 最小化安装后IP的配置(手动获取静态IP地址)的相关文章

linux最小化安装后操作

1.由于最小化安装.虚拟机无法识别到本地网卡.解决办法 第一步.系统无法识别eth0网卡.ifconfig eth0 192.168.100.150第二步.进/etc/sysconfig/network-scripts/第三步.copy回环地址模板cp ifcfg-lo  ifcfg-eth0第四步.进vi里更改内容 vim /etc/sysconfig/network-scripts/ifcfg-eth0第五步.重启网卡 service network restart第六步.开启ssh服务 s

Centos7/redhat7最小化安装后的简单配置

一.配置本地yum源 1.挂载: [[email protected] ~]# mount /dev/cdrom /mnt mount: block device /dev/cdrom is write-protected, mounting read-only [[email protected] ~]# cd /etc/yum.repos.d/ [[email protected] yum.repos.d]# vi rhel-debuginfo.repo     --添加下面内容 [loca

Linux最小化安装后配置网络

vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0HWADDR=00:0C:29:DD:AD:B9TYPE=EthernetUUID=d718b744-4016-4334-bb39-f6183926e700ONBOOT=yesNM_CONTROLLED=yesBOOTPROTO=staticIPADDR=192.168.1.118NETMASK=255.255.255.0#BROADCAST=192.168.1.1GATEWAY=19

debian7.7最小化安装后的基本配置

1.配置ip地址 [email protected]:~# cat /etc/network/interfaces # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo ine

redhat7最小化安装后网络的配置

1.使用ip addr 查看ip地址,检查ip是否生效,一安装好redhat7的时候,默认是没有配置ip地址的 [[email protected] ~]# ip addr 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00     inet 127.0.0.1/8 scope host lo

【Linux】CentOS6.X最小化安装后配置

1.centos6.5最小化安装后启动网卡2.ifconfig查询IP进行SSH链接3.更新系统源并且升级系统4.系统时间更新和设定定时任5.修改ip地址.网关.主机名.DNS6.关闭selinux,清空iptables7.创建普通用户并进行sudo授权管理8.修改SSH端口号和屏蔽root账号远程登陆9.锁定关键文件系统(禁止非授权用户获得权限)10.精简开机自启动服务11.调整系统文件描述符大小12.设置系统字符集13.清理登陆的时候显示的系统及内核版本14.内核参数优化15.定时清理/va

Linux最小化安装网络配置

Linux最小化安装网络配置 配置网络ip vi /etc/sysconfig/network-scripts/ifcfg-ens33(将选中的部分改为yes) 保存退出并重启网络 service network restart 3.最小化安装没有ifconfig要用ip addr查看ip地址 ssh连接到MobaXterm 下载dokuwiki前安装必要工具 安装vimyum -y install vim 安装wgetyum -y install wget 安装net-tools(已安装过)

生产服务器最小化安装后CentOS6.5优化配置

第一步:启动网卡 #centos6.x最小化安装后,网卡默认不是启动状态 $ifup eth0 第二步:查看IP地址后,用putty或CRT链接 第三步:更新源,安装wget #安装wget $yum install wget #备份原系统更新源 #mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup #进入yum.repos.d目录 $cd /etc/yum.repos.d/ #下载网易镜像源

Centos 7最小化安装后配置

关闭SELINUX vi /etc/sysconfig/selinux SELINUX=disabled :wq 配置网卡(最小化安装后ifconfig无法使用),该配置的前提是采用 NAT模式 vi /etc/sysconfig/network-scripts/ifcfg-enp0s3 ONBOOT=yes :wq service network restart # 检查网卡 ip addr 或者 ping -c2 www.baidu.com 更新yum yum -y update 联网后安装