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

How to solve the problem that linux cannot access the external network

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

1. First configure static ip. Dynamic ip allocation needs to be removed.

2. The third IP address range of the subnet should be different from that of the host. In this paper, the third network segment of the host IP is: 1, and the third network segment of the virtual machine is set to: 239

3. NET settings

4. Ifcfg-ens33 file configuration.

Cd / etc/sysconfig/network-scriptsvim ifcfg-ens33TYPE=EthernetPROXY_METHOD=noneBROWSER_ONLY=noDEFROUTE=yesPEERDNS=yesPEERROUTES=yesIPV4_FAILURE_FATAL=noIPV6INIT=yesIPV6_AUTOCONF=yesIPV6_DEFROUTE=yesIPV6_PEERDNS=yesIPV6_PEERROUTES=yesIPV6_FAILURE_FATAL=noIPV6_ADDR_GEN_MODE=stable-privacyNAME=ens33DEVICE=ens33PREFIX=16 # UUID default UUID=4d1c2382-814d-45e1-a5b9-252086ceff86 # this part of the setting is the most important need to be set according to the actual situation. # configuration method of BOOTPROTO IP [none | static | bootp | dhcp] (do not use protocol when booting | static assign IP | BOOTP protocol | DHCP protocol) whether the network interface is valid when the BOOTPROTO=static# ONBOOT system starts (yes/no) ONBOOT=yesIPADDR=192.168.239.128 # the first three network segments are configured according to the virtual machine settings. 192.168.239.xxx the last xxx is between 0-255. it's important that the gateway Configure DNS1=8.8.8.8 # DNS according to the gateway set by the virtual machine, otherwise you may not be able to access the DNS2=114.114.114.114

5. Restart the network service

Service network restart

These are the details of the solution that linux cannot access the public network. Please pay attention to other related articles for more information.

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