In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Read the Linux server double network card double IP and single network card double IP configuration method one, double network card double IP.
Eth0 is China Telecom and eth2 is China Unicom.
# cd / etc/sysconfig/network-scripts/# vi ifcfg-eth0DEVICE=eth0HWADDR=00:e0:b1:07:d5:86ONBOOT=yesBOOTPROTO=noneIPADDR=1.2.3.4NETMASK=255.255.255.0GATEWAY=1.2.3.1TYPE=Ethernet# wq# vi ifcfg-eth2DEVICE=eth2HWADDR=00:e0:b2:09:d5:87ONBOOT=yesBOOTPROTO=noneIPADDR=2.3.4.5NETMASK=255.255.255.0TYPE=Ethernet# wq
Note: eht1 does not add gateway addresses.
Then do policy routing (the policy routing file is provided by the computer room).
Second, single network card and double IP. # cd / etc/sysconfig/network-scripts/# cp ifcfg-eth0 ifcfg-eth0:1# vi ifcfg-eth0DEVICE=eth0ONBOOT=yesBOOTPROTO=noneHWADDR=00:0c:29:7d:dc:03IPADDR=192.168.0.10 / / Telecom IP address. NETMASK=255.255.255.0GATEWAY=192.168.0.1TYPE=Ethernet# vi ifcfg-eth0:1DEVICE=eth0:1ONBOOT=yesBOOTPROTO=noneHWADDR=00:0c:29:7d:dc:03IPADDR=172.16.0.10 / / Unicom IP address. NETMASK=255.255.255.0TYPE=Ethernet
Note: only need to change the device name and IP address, do not add the gateway.
Activate the network card.
# ifup eth0:1 verifies that the IP address is valid. # ifconfig eth0:1# ping 192.168.0.10# ping 172.16.0.10
Then do policy routing.
Third, configure policy routing.
Put the route list file in any directory, give executable permissions, then execute it, and finally add boot autorun in the rc.local file.
# cd / etc/sysconfig/# chmod 775 static-routes / / assume that the route list file named static-routes is placed in the / etc/sysconfig/ directory. #. / static-routes# cd / etc/rc.d/# vi rc.local/etc/sysconfig/static-routes# wq
Original address of this article: https://www.linuxprobe.com/linux-ip.html
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: 299
*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.