Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Oracle Linux 7.1Add network card and IP configuration

2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Due to the need to add the network card to the virtual machine (oracle linux 7.1) and set the IP operation, execute the ifconfig command after the increase of the network card, you can see the increased network card information, but no network card configuration file is generated

[root@jytest1] # ifconfigens34: flags=4163 mtu 1500 ether 00:50:56:a0:7e:4c txqueuelen 1000 (Ethernet) RX packets 14332 bytes 1177864 (1.1MiB) RX errors 0 dropped 25 overruns 0 frame 0 TX packets 0 bytes 0 (0.0B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0ens160: flags=4163 mtu 1500 inet 10.138.130.171 netmask 255.255.255.0 broadcast 10.138.130. 255 inet6 fe80::250:56ff:feb1:260 prefixlen 64 scopeid 0x20 ether 00:50:56:b1:02:60 txqueuelen 1000 (Ethernet) RX packets 14524 bytes 1203727 (1.1 MiB) RX errors 0 dropped 11 overruns 0 frame 0 TX packets 349 bytes 31569 (30.8 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo: flags=73 mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 Inet6:: 1 prefixlen 128 scopeid 0x10 loop txqueuelen 0 (Local Loopback) RX packets 1152 bytes 89096 (87.0 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 1152 bytes 89096 (87.0 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0virbr0: flags=4099 mtu 1500 inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255 ether 52:54:00: 88:ce:47 txqueuelen 0 (Ethernet) RX packets 0 bytes 0 (0.0B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 6 bytes 1172 (1.1KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 [root@jytest1] # cd / etc/sysconfig/network-scripts [root@jytest1 network-scripts] # ls-lrttotal 232-rwxr-xr-x. 1 root root 1876 Nov 6 2014 ifup-TeamPort-rwxr-xr-x. 1 root root 1755 Nov 6 2014 ifup-Team-rwxr-xr-x. 1 root root 1556 Nov 6 2014 ifdown-TeamPort-rwxr-xr-x. 1 root root 1599 Nov 6 2014 ifdown-Team-rw-r--r--. 1 root root 26134 Jan 15 2015 network-functions-ipv6-rw-r--r--. 1 root root 15316 Jan 15 2015 network-functions-rwxr-xr-x. 1 root root 4623 Jan 15 2015 init.ipv6-global-rwxr-xr-x. 1 root root 1740 Jan 15 2015 ifup-wireless-rwxr-xr-x. 1 root root 2682 Jan 15 2015 ifup-tunnel-rwxr-xr-x. 1 root root 3263 Jan 15 2015 ifup-sit-rwxr-xr-x. 1 root root 1925 Jan 15 2015 ifup-routes-rwxr-xr-x. 1 root root 4154 Jan 15 2015 ifup-ppp-rwxr-xr-x. 1 root root 2609 Jan 15 2015 ifup-post-rwxr-xr-x. 1 root root 1043 Jan 15 2015 ifup-plusb-rwxr-xr-x. 1 root root 642 Jan 15 2015 ifup-plip-rwxr-xr-x. 1 root root 10430 Jan 15 2015 ifup-ipv6-rwxr-xr-x. 1 root root 12039 Jan 15 2015 ifup-ippp-rwxr-xr-x. 1 root root 11502 Jan 15 2015 ifup-eth-rwxr-xr-x. 1 root root 859 Jan 15 2015 ifup-bnep-rwxr-xr-x. 1 root root 12616 Jan 15 2015 ifup-aliases-rwxr-xr-x. 1 root root 1462 Jan 15 2015 ifdown-tunnel-rwxr-xr-x. 1 root root 1444 Jan 15 2015 ifdown-sit-rwxr-xr-x. 1 root root 837 Jan 15 2015 ifdown-routes-rwxr-xr-x. 1 root root 1068 Jan 15 2015 ifdown-ppp-rwxr-xr-x. 1 root root 1642 Jan 15 2015 ifdown-post-rwxr-xr-x. 1 root root 4201 Jan 15 2015 ifdown-ipv6-rwxr-xr-x. 1 root root 781 Jan 15 2015 ifdown-ippp-rwxr-xr-x. 1 root root 5817 Jan 15 2015 ifdown-eth-rwxr-xr-x. 1 root root 627 Jan 15 2015 ifdown-bnep-rw-r--r--. 1 root root 254 Jan 15 2015 ifcfg-lo-rwxr-xr-x. 1 root root 10145 Mar 6 2015 ifup-ib-rwxr-xr-x. 1 root root 6196 Mar 6 2015 ifdown-iblrwxrwxrwx. 1 root root 24 Nov 5 10:11 ifdown->.. / usr/sbin/ifdownlrwxrwxrwx. 1 root root 11 Nov 5 10:11 ifdown-isdn-> ifdown-ippplrwxrwxrwx. 1 root root 22 Nov 5 10:11 ifup->.. / usr/sbin/ifuplrwxrwxrwx. 1 root root 9 Nov 5 10:11 ifup-isdn-> ifup-ippp-rw-r--r--. 1 root root 358 Nov 5 12:01 ifcfg-ens160

You can see that the network card configuration file ifcfg-ens34 is not generated, and the network card ens160 added before when creating the virtual machine has the corresponding configuration file ifcfg-ens160. Nmtui is used to set up the network in oracle linux 7.1. nmtui belongs to curses-based text user interface (text user interface), similar to the previous setup tools of Linux7.

[root@jytest1 ~] # nmtui

After setting up using nmtui, you can see the configuration file ifcfg-ens34 that generated the network card ens34.

[root@jytest1 network-scripts] # ls-lrttotal 236-rwxr-xr-x. 1 root root 1876 Nov 6 2014 ifup-TeamPort-rwxr-xr-x. 1 root root 1755 Nov 6 2014 ifup-Team-rwxr-xr-x. 1 root root 1556 Nov 6 2014 ifdown-TeamPort-rwxr-xr-x. 1 root root 1599 Nov 6 2014 ifdown-Team-rw-r--r--. 1 root root 26134 Jan 15 2015 network-functions-ipv6-rw-r--r--. 1 root root 15316 Jan 15 2015 network-functions-rwxr-xr-x. 1 root root 4623 Jan 15 2015 init.ipv6-global-rwxr-xr-x. 1 root root 1740 Jan 15 2015 ifup-wireless-rwxr-xr-x. 1 root root 2682 Jan 15 2015 ifup-tunnel-rwxr-xr-x. 1 root root 3263 Jan 15 2015 ifup-sit-rwxr-xr-x. 1 root root 1925 Jan 15 2015 ifup-routes-rwxr-xr-x. 1 root root 4154 Jan 15 2015 ifup-ppp-rwxr-xr-x. 1 root root 2609 Jan 15 2015 ifup-post-rwxr-xr-x. 1 root root 1043 Jan 15 2015 ifup-plusb-rwxr-xr-x. 1 root root 642 Jan 15 2015 ifup-plip-rwxr-xr-x. 1 root root 10430 Jan 15 2015 ifup-ipv6-rwxr-xr-x. 1 root root 12039 Jan 15 2015 ifup-ippp-rwxr-xr-x. 1 root root 11502 Jan 15 2015 ifup-eth-rwxr-xr-x. 1 root root 859 Jan 15 2015 ifup-bnep-rwxr-xr-x. 1 root root 12616 Jan 15 2015 ifup-aliases-rwxr-xr-x. 1 root root 1462 Jan 15 2015 ifdown-tunnel-rwxr-xr-x. 1 root root 1444 Jan 15 2015 ifdown-sit-rwxr-xr-x. 1 root root 837 Jan 15 2015 ifdown-routes-rwxr-xr-x. 1 root root 1068 Jan 15 2015 ifdown-ppp-rwxr-xr-x. 1 root root 1642 Jan 15 2015 ifdown-post-rwxr-xr-x. 1 root root 4201 Jan 15 2015 ifdown-ipv6-rwxr-xr-x. 1 root root 781 Jan 15 2015 ifdown-ippp-rwxr-xr-x. 1 root root 5817 Jan 15 2015 ifdown-eth-rwxr-xr-x. 1 root root 627 Jan 15 2015 ifdown-bnep-rw-r--r--. 1 root root 254 Jan 15 2015 ifcfg-lo-rwxr-xr-x. 1 root root 10145 Mar 6 2015 ifup-ib-rwxr-xr-x. 1 root root 6196 Mar 6 2015 ifdown-iblrwxrwxrwx. 1 root root 24 Nov 5 10:11 ifdown->.. / usr/sbin/ifdownlrwxrwxrwx. 1 root root 11 Nov 5 10:11 ifdown-isdn-> ifdown-ippplrwxrwxrwx. 1 root root 22 Nov 5 10:11 ifup->.. / usr/sbin/ifuplrwxrwxrwx. 1 root root 9 Nov 5 10:11 ifup-isdn-> ifup-ippp-rw-r--r--. 1 root root 346 Mar 16 12:36 ifcfg-ens160-rw-r--r--. 1 root root 181 Mar 16 12:42 ifcfg-ens34

Edit configuration file

[root@jytest1 network-scripts] # vi ifcfg-ens34TYPE=EthernetBOOTPROTO=noneIPADDR=88.88.88.1NETMASK=255.255.255.0PREFIX=32DEFROUTE=yesIPV4_FAILURE_FATAL=noIPV6INIT=noNAME=ens34UUID=f0e4fffc-668c-4b3d-b1cf-ab2b0122dd7dDEVICE=ens34ONBOOT=yes

Restart the network

[root@jytest1 network-scripts] # systemctl restart network [root@jytest1 network-scripts] # ifconfigens34: flags=4163 mtu 1500 inet 88.88.1 netmask 255.255.255.255 broadcast 88.88.1 inet6 fe80::250:56ff:fea0:7e4c prefixlen 64 scopeid 0x20 ether 00:50:56:a0:7e:4c txqueuelen 1000 (Ethernet) RX packets 24804 bytes 2064784 (1.9 MiB) RX errors 0 dropped 25 overruns 0 frame 0 TX packets 57 bytes 8254 (8.0 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0ens160: flags=4163 mtu 1500 inet 10.138.130.171 netmask 255.255.255.0 broadcast 10.138.130.255 inet6 fe80::250:56ff:feb1:260 prefixlen 64 scopeid 0x20 ether 00:50:56:b1:02:60 txqueuelen 1000 (Ethernet) RX packets 25331 bytes 2120003 (2.0 MiB) RX errors 0 dropped 11 overruns 0 frame 0 TX packets 767 bytes 84120 (82.1 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo: flags=73 mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6:: 1 prefixlen 128 scopeid 0x10 loop txqueuelen 0 (Local Loopback) RX packets 1480 bytes 113808 (111.1 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 1480 bytes 113808 1 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0virbr0: flags=4099 mtu 1500 inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255 ether 52:54:00:88:ce:47 txqueuelen 0 (Ethernet) RX packets 0 bytes 0 (0.0B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 6 bytes 1172 (1.1 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 [root@jytest1 network-scripts] # ping jytest1-privPING jytest1-priv (88.88.88.1) 56 (84) bytes of data.64 bytes from jytest1-priv (88.88.88.1): icmp_seq=1 ttl=64 time=0.419 ms64 bytes from jytest1-priv (88.88.88.1): icmp_seq=2 ttl=64 time=0.227 Ms ^ C-jytest1-priv ping statistics-2 packets transmitted 2 received, 0% packet loss, time 1001msrtt min/avg/max/mdev = 0.227 packet loss 0.323 packet loss 0.419 ms

Configuration complete

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report