linux ip的配置以及网关(unit11)
来源:互联网 发布:古建筑效果图制作软件 编辑:程序博客网 时间:2024/06/05 17:21
#
11.管理网络
#
1.ip基础知识
1.ipv4
2进制32位—–10进制
172.25.0.10/255.255.255.0
172.25.0.10:ip地址
255.255.255.0:子网掩码
子网掩码255位对应的ip位为网络位
子网掩码0对应的ip位为主机位
2.配置ip
<<图形化>>
1.图形界面
nm-connection-editor
2.文本化图形
nmtui
<<命令>>
ifconfig 网卡 ip netmask ##临时设定
nmcli connection add type ethernet con-name westos ifname eth0 autoconnect yes
nmcli connection add type ethernet con-name westos ifname eth0 ip4 ip/24
nmcli connection delete westos
nmcli connection show
nmcli connection down westos
nmcli connection up westos
nmcli connection modify “westos” ipv4.addresses newip/24
nmcli connection modify “westos” ipv4.method
3.gateway 网关
1.路由器
主要功能是用来作nat的
dnat 目的地地址转换
snat 源地址转换
2.网关
路由器上和自己处在同一个网段的那个ip
3.设定网关
systemctl stop NetwrokManager
vim /etc/sysconfig/network ##全局网关
GATEWAY=网关ip
vim /etc/sysconfig/network-scripts/ifcfg-网卡配置文件 ##网卡接口网关
GATEWAY=网关ip
systemctl restart netwrok
route -n ##查询网关
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 (网关)172.25.0.254 0.0.0.0 UG 0 0 0 eth0
172.25.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
5.dns
1.dns
dns是一台服务器
这太服务器提供了回答客户主机名和ip对应关系的功能
2.设定dns
vim /etc/resolv.conf
nameserver dns服务器ip
vim /etc/sysconfig/network-scripts/ifcfg-网卡配置文件
DNS1=dns服务器ip
3.本地解析文件
vim /etc/hosts
ip 主机名称
4.本地解析文件和dns读取的优先级调整
/etc/nsswitch.conf
38 #hosts: db files nisplus nis dns
39 hosts: files dns ##files代表本地解析文件,dns代表dns服务器,那个在前面那个优先
5.dhcp服务的配置
- linux ip的配置以及网关(unit11)
- 怎样配置Redhat Linux的IP和网关啊?
- linux 主机的网络别名、IP、网关配置
- 配置centos的静态ip 以及网关 Configure Static IP Address in CentOS
- linux命令配置静态IP与网关
- linux配置ip 网关 和dns
- Linux 网络ip,网关,DNS配置
- linux主机ip,网关,子网掩码,DNS配置
- linux命令行配置ip及网关
- linux 下设置ip,子网掩码以及网关的命令与使用方法
- Linux配置网关的命令
- linux中IP,网关的设置
- linux 的 IP 及网关设置
- linux的设置IP、掩码、网关
- linux下修改ip和网关以及dns
- linux C 获取ip mac 广播地址,以及网关
- Linux系统中添加IP地址以及默认网关
- Linux系统 C++ 获取网络接口,以及主机网关IP
- 如何求∫e^(-x^2 )dx在(-∞,+∞)上的值
- 如何快速转载CSDN中的博客
- lnux系统日志及时间同步(unit10)
- HDU 2108 JAVA
- 汇编笔记1
- linux ip的配置以及网关(unit11)
- 华为面试题
- HDU 2109 JAVA
- linux 文件压缩解压、上传与下载(unit12)
- HDU 2111 JAVA
- hibernate 实现多表连接查询(转载)
- 朝思暮想的电商项目
- linux 软件安装的两种方法,以及使用镜像的两种路径(unit13)
- HDU 2113 JAVA