In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-23 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: 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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.