最新消息: USBMI致力于为网友们分享Windows、安卓、IOS等主流手机系统相关的资讯以及评测、同时提供相关教程、应用、软件下载等服务。

配置 IP 地址

业界 admin 10浏览 0评论

进入文件

root@localhost 桌面]# vim /etc/sysconfig/network-scripts/ifcfg-eno16777736 

改配置文件

TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=eno16777736
UUID=f3ea634c-d078-4590-aed4-51bc7530d093
DEVICE=eno16777736
ONBOOT=yes
IPADDR=192.168.137.6
NETMASK=255.255.255.0
GATEWAY=192.168.137.1
DNS=8.8.8.8

改完之后重启刷新

[root@localhost 桌面]# service netwok restart

ifconfig 查看配置

[root@localhost 桌面]# ifconfig 
eno16777736: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.137.6  netmask 255.255.255.0  broadcast 192.168.137.255
        inet6 fe80::20c:29ff:fec0:d961  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:c0:d9:61  txqueuelen 1000  (Ethernet)
        RX packets 127  bytes 12653 (12.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 100  bytes 11568 (11.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 24  bytes 2364 (2.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 24  bytes 2364 (2.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 00:00:00:00:00:00  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

远程连接 ssh 对方IP
打yes
输入对方密码
退出 exit

安包

[root@localhost 桌面]# yum repolist

systemctl start httpd

进入文件

root@localhost 桌面]# vim /etc/sysconfig/network-scripts/ifcfg-eno16777736 

改配置文件

TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=eno16777736
UUID=f3ea634c-d078-4590-aed4-51bc7530d093
DEVICE=eno16777736
ONBOOT=yes
IPADDR=192.168.137.6
NETMASK=255.255.255.0
GATEWAY=192.168.137.1
DNS=8.8.8.8

改完之后重启刷新

[root@localhost 桌面]# service netwok restart

ifconfig 查看配置

[root@localhost 桌面]# ifconfig 
eno16777736: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.137.6  netmask 255.255.255.0  broadcast 192.168.137.255
        inet6 fe80::20c:29ff:fec0:d961  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:c0:d9:61  txqueuelen 1000  (Ethernet)
        RX packets 127  bytes 12653 (12.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 100  bytes 11568 (11.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 24  bytes 2364 (2.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 24  bytes 2364 (2.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 00:00:00:00:00:00  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

远程连接 ssh 对方IP
打yes
输入对方密码
退出 exit

安包

[root@localhost 桌面]# yum repolist

systemctl start httpd

发布评论

评论列表 (0)

  1. 暂无评论