Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Debian Redhat standard network card configuration

Shulou Source: shulou.com Published: 2022-06-01 03:55:18 10月06日 Update

For Debian Linux

Set ip temporarily first Then log in to root@ubuntu:~# ifconfig eth0 10.11.12.2/24root@raspberrypi:~# vim / etc/network/interfaces# Please note that this file is written to be used with dhcpcd.# For static IP Consult / etc/dhcpcd.conf and 'man dhcpcd.conf'.auto loiface lo inet loopback#auto eth0#allow-hotplug eth0#iface eth0 inet manualauto eth0iface eth0 inet staticaddress 10.11.12.19netmask 255.255.255.0gateway 10.11.12.13dns-nameservers 180.76.76.76 223.5.5.5auto wlan0allow-hotplug wlan0iface wlan0 inet manualwpa-conf / etc/wpa_supplicant/wpa_supplicant.confauto wlan1allow-hotplug wlan1iface wlan1 inet manualwpa-conf / etc/wpa_supplicant/wpa_supplicant.confroot@raspberrypi:~ # restart network root@ubuntu:~# ifdown eth0 & & ifup eth0 or: root@raspberrypi:~# / etc/init.d/networking restart [....] Restarting networking (via systemctl): networking.serviceWarning: Unit file of networking.service changed on disk, 'systemctl daemon-reload' recommended.. Ok root@raspberrypi:~# echo $? 0 Test root@raspberrypi:~# ping www.baidu.comPING www.a.shifen.com (115.239.210.27) 56 (84) bytes of data.64 bytes from 115.239.210.27: icmp_seq=1 ttl=57 time=2.76 ms64 bytes from 115.239.210.27: icmp_seq=2 ttl=57 time=2.78 Ms ^ C-www.a.shifen.com ping statistics-2 packets transmitted, 2 received, 0 packet loss Time 1001msrtt min/avg/max/mdev = 2.761 / 2.770 / 2.780 / 0.053 msroot@raspberrypi:~#

For Redhat Linux

Temporarily modify the network card IPifconfig eth0 172... 16.0.5 4d23-a333-a84da8341***ONBOOT=yesNM_CONTROLLED=yesBOOTPROTO=staticIPADDR=172.16.0.103NETMASK=255.255.255.0GATEWAY=172.16.0.111DNS1=114.114.114.114DNS2=8.8.8.8 16 up add gateway route add default gw 172.16.0.111 temporarily modify the default DNSvim / etc/resolv.confvim / etc/sysconfig/network-scripts/ifcfg-eth2DEVICE=eth2HWADDR=00:0C:29:36:**:**TYPE=EthernetUUID=7eaffa26-ee97-4d23-a333-a84da8341***ONBOOT=yesNM_CONTROLLED=yesBOOTPROTO=staticIPADDR=172.16.0.103NETMASK=255.255.255.0GATEWAY=172.16.0.111DNS1=114.114.114.114DNS2=8.8.8.8

Tags: Network card gateway network test login standard configuration Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Huawei Xiaomi NVidia Linux