In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article shows you how to build a bridge in Ubuntu. The content is concise and easy to understand. It will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
Network example of bridging
In this example, eth0 and eth2 are physical network interfaces. Eth0 is connected to the local area network, and eth2 is connected to the upstream router and the Internet.
Install bridge-utils
Use the apt-get command to install bridge-utils:
$sudo apt-get install bridge-utils
Or
$sudo apt install bridge-utils
Sample output:
Create a bridge on the Ubuntu server
Modify using a text editor that you are familiar with
/ etc/network/interfaces
For example, vi or nano:
$sudo cp / etc/network/interfaces / etc/network/interfaces.bakup-1-july-2016$ sudo vi / etc/network/interfaces
Next, set up eth2 and map it to br1, enter the following (delete or comment all eth2-related configurations):
# br1 uses static public network IP address and uses ISP router as the gateway auto br1iface br1 inet static address 208.43.222.51 network 255.255.255.248 netmask 255.255.255.0 broadcast 208.43.222.55 gateway 208.43.222.49 bridge_ports eth2 bridge_stp off bridge_fd 0 bridge_maxwait 0
Next, set up eth0 and map it to br0, and enter the following (delete or comment all eth0-related configurations):
Auto br0iface br0 inet static address 10.18.44.26 netmask 255.255.255.192 broadcast 10.18.44.63 dns-nameservers 10.0.80.11 10.0.80.12 # set static route for LAN post-up route add-net 10.0.0.0 netmask 255.0.0.0 gw 10.18.44.1 post-up route add-net 161.26.0.0 netmask 255 .255.0.0 gw 10.18.44.1 bridge_ports eth0 bridge_stp off bridge_fd 0 bridge_maxwait 0
A note about br0 and DHCP
If you use DHCP, the configuration options are as follows:
Auto br0iface br0 inet dhcp bridge_ports eth0 bridge_stp off bridge_fd 0 bridge_maxwait 0
Save and close the file.
Restart the server or network service
You need to restart the server or enter the following command to restart the network service (this may not work in a SSH login session):
$sudo systemctl restart networking
If you use Ubuntu 14.04 LTS or older systems that do not have systemd, enter:
$sudo / etc/init.d/restart networking
Verify that the network configuration is successful
Use the ping/ip command to verify that the LAN and WAN network interfaces are operational:
# View br0 and br1ip a show### to view routing information ip renders # ping external site ping-c 2 cyberciti.biz### ping LAN server ping-c 2 10.0.80.12
Sample output:
The above content is how to build a bridge in Ubuntu. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
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.