In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to achieve shared access to the Internet by Linux". In daily operation, I believe many people have doubts about how to achieve shared access to the Internet by Linux. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the doubts about "how to achieve shared access to the Internet by Linux"! Next, please follow the editor to study!
Set up a Linux DHCP server. If it is a Ubuntu system, directly
# apt-get install dhcpd
Change the / etc/dhcpd.conf file after installation and add:
Option domain-name-servers 202.96.134.188202.96.134.133 ETS defaultMutual netmask time 600 maxim Musical time 7200 subnet 192.168.1.0 netmask 255.255.255.0 {range 192.168.1.2 192.168.1.200 option routers 192.168.20.1;}
DHCP is set up. Next, you need to set up one more IP for the Linux host and set the IPtable rules.
Sudo ifconfig eth0:1 192.168.20.1sudo sh-c "echo 1 > / proc/sys/net/ipv4/ip_forward" sudo iptables-A FORWARD-s 192.168.20.0 take 24-j ACCEPTsudo iptables-A FORWARD-I eth0-m state-state ESTABLISHED,RELATED-j ACCEPT
You can write the above statement to a script. If you need to execute it, you can turn on the sharing function.
The window machine only needs to be set to automatically obtain the IP (or set to 192.168.20.x network segment, the gateway is 192.168.20.1). The physical connection is through the hub.
The situation of each person is different, and everyone should modify it according to his own situation.
At this point, the study on "how to share the Internet with Linux" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.