How and why to create a bridge connection. How to create a bridged Internet connection Configuring a bridge between two networks

Used by me, at the time of writing, release VirtualBox 3.1.6 rev59331. You can download the "machine" from the SUN website (now Oracle VM VirtualBox)
I will not describe how to install this virtualization system, even a beginner will figure it out.

The most interesting thing is not even in installing the most desired OS. The process of installing a guest system is simple and does not require any additional effort from the user. When creating a virtual machine, you must select the type of guest you want to install, determine the amount of RAM to allocate to it, and create a fixed-size virtual disk or dynamically expand as it fills up in the guest. The further installation process is the same as in other virtualization platforms. Settings can be changed after installing the guest OS by clicking Properties for the selected virtual machine.

I met all the nuances of the settings in detail in various articles, except for setting up the network. We press in the right window NETWORK. The following window opens. Four network adapters can be configured here.

Concerning NAT, then here everything is very clear and is configured automatically. Your virtual computer is behind a virtual gateway. In the Internet gets at once. True, there are a couple of BUT ... :) The first but ... the provider distributes the Internet using MAC addresses and fixed IP... conflict. The second but ... in the local network (if it exists) the machine is not visible ... you can really connect to the local network via VPN… if there VPN server. :))) In extreme cases, suitable RDP.

There were no problems with setting up the internal network either. Started up right away. I won’t write about the appointment, everyone will decide why he needs it.


Most of all I had to tinker with the setting Network Bridge! Where to begin. There is also an alternative way to configure a network bridge for a virtual machine in virtual box.
After installation virtual box Network Connections now has a virtual network adapter. It's highlighted in the next picture.


True, the screen is of a later state, namely after the interfaces were combined into a network bridge, but I was too lazy to disconnect, sorry.

But before combining a real network adapter and a virtual one, you need to configure the virtual one.
To do this, go to the window virtual box: File-Settings.

Select the network adapter and press the screwdriver (setting).

We score IP the address is different from the real one, from a different subnet.
With a real network adapter 192.168.16.103 , mask 255.255.255.0 For virtual, for example 10.0.1.1 , mask 255.255.255.0

The address specified here will immediately be registered in the network settings of the virtual network adapter of the main OS. You can check it in the Network Connections window by clicking on the properties for the relevant connection. I tried to drive it directly, then when I start the guest OS, a network adapter error pops up.

Now there is very little left.

We combine physical and virtual network adapters in network bridge. To do this, go to network connections, select the appropriate network adapters with CTRL, right-click, select the item to create a network bridge. We wait a bit and voila! network bridge and the Network Gateway icon appeared. We check the presence of the Internet on the main machine, it must be. Next, we start the virtual machine and configure the network adapter there. Since I have a DHCP server on my network, we set the automatically received settings. If you want to manually configure, the address must be from the same subnet as the physical adapter !
Well, like everything. We check the presence of the Internet.

As you can see, everything worked out. We connect network resources as in a regular OS.

Computer QWE-PC - virtual. Basically, when setting virtual box There were no difficulties, everything is intuitive, plus tooltips. Good luck! :)

2016-02-14T01:27:18+01:00

In the situations under consideration, the Windows XP operating system was installed on all computers.

In the first case, the cable modem was connected directly to the computer's network adapter (1). Connection to the Internet was carried out without dialing, i.е. via DHCP. For this connection, I created a shared access (Internet Connection Sharing). The second network device on this computer was the Edimax wireless USB adapter. Read about setting up a home wireless network in my.
When creating Internet Access Sharing (ICS), the second network device, in our case the wireless adapter, was automatically assigned the IP address 192.168.0.1 with a subnet mask of 255.255.255.0 . In addition, I manually assigned my ISP's DNS server addresses.
I connected the second computer (2) using a network card to homeplug, which, in turn, connected, as expected, to the mains. I gave this computer an IP address 192.168.0.3 , a gateway address (Gateway) 192.168.0.1 and a DNS server address 192.168.0.1

The laptop (3) is the same, I connected the adapter via ethernet to the second home plug device and the wireless USB adapter. Read about setting up a wireless adapter in my . Now we need to create a network bridge (Network bridge) for these two devices in order to combine all three computers into one network.
So, to create a network bridge, you must have at least two network adapters. We go into Network Connections, select both network devices with the mouse and right-click to call up the context menu, where we select the Network Bridge option.

We have a third connection for which we now need to set our network settings.

network bridge

Network Bridge simplifies the installation and configuration of small networks that use different types of connections (such as a wireless network connection and a wired Ethernet connection) by connecting different types of networks.

A network bridge provides small businesses with more flexibility in choosing their network type and eliminates the need to purchase additional bridges and routers.

A network bridge is used to connect LAN segments cheaply and easily. A LAN segment is a part of a network carrier that links a group of computers together. Most often, a network consists of several LAN segments. Before the advent of Windows XP;, Windows Server 2003, Standard Edition, and Windows Server 2003, Enterprise Edition, two methods were used to create a network containing multiple LAN segments: IP routing and bridge equipment. IP routing requires purchasing hardware routers or setting up computers and assigning IP addresses to each computer on each network segment, and configuring each network segment as a separate subnet. Bridge equipment does not require such complex setup, but in this case, additional equipment for bridges will be needed. When using different types of network media, you will need to create a separate subnet for each type of media.

However, in Windows XP;, Windows Server 2003, Standard Edition, and Windows Server 2003, Enterprise Edition, you have the convenience of connecting LAN segments by selecting the Bridge Connections menu command. No configuration required, no need to purchase additional hardware such as bridges or routers. A network bridge automates the configuration required to route traffic between multiple segments of a network consisting of one or more media types.

Using a network bridge, you can connect an Ethernet network adapter, an HPNA network adapter, and a wireless adapter on PC1. Using a network bridge, you can direct traffic from one LAN segment to another and enable all computers to communicate with each other.

But what if, for example, in such an "average network" we have a switch (three stationary computers, a couple of laptops and handhelds), but no router and access point? And I really don't want to buy them.

That is, two different networks - wired, which has Internet access and wireless (without it). Networks do not see each other. How to link all computers together?

We will consider the second way of connecting wired and wireless clients, using the bridge type mechanism built into Windows XP.

To do this, we just need to insert a third network adapter, this time wireless, into a computer that is a router and has two network adapters (one looking at the local network, the second at the Internet).

Time to activate the bridge. This mechanism will allow us to bridge our wired and wireless networks so that computers on those networks can see each other.

In simple terms, a bridge is a mechanism that transparently (for working clients) connects dissimilar network segments. In our case, heterogeneous segments mean a wired network and a wireless network.

We configure the future computer-router. Switch local interfaces to bridge mode:
LAN - looking into a wired local area network
Wireless - looking into the wireless LAN

Only a bridge, by definition, works at least between two interfaces.

Therefore, select both local interfaces, press the right mouse button and select the "Bridge connection" item in the menu that appears.

Windows starts the bridge creation process.

After the end of this process, another connection appears in the network connections - Network Bridge (network bridge). And in the information on network adapters on which the bridge mode is set, the status "Connected" appears.

The bridge is presented as a separate device, most of its parameters repeat the parameters of network adapters.

True, in the "properties" section there is an additional section with a list of adapters that currently belong to the bridge (there can be two or more adapters).

Actually, at this stage, all networks that these (assigned to the bridge) adapters look at see each other directly, without routing. That is, as if the clients in these networks are sitting in one large homogeneous network (in other words, as if connected to the same switch).

The bridge is assigned its own IP address, which is the same for all adapters assigned to the bridge.

Of course, there are no IP addresses in the properties of the adapters themselves. The adapter, as such, no longer exists at the logical level - there is only a bridge (having an IP address) that includes two (or more) adapters.

A network bridge manages network segments and creates one subnet for the entire network. No configuration required, no need to purchase additional hardware such as bridges or routers. If the IP network consists of a single subnet, IP addressing, address distribution, and name resolution are greatly simplified.

To connect the computers on separate LAN segments together, there are two solutions:

Create multiple network segments and connect them with routers. In this solution, each LAN segment becomes a network segment, also known as a subnet. A network segment is a portion of a network that shares the same network identifier and is bounded by routers. With multiple network segment, nodes on separate network segments send packets to a router, which forwards the packets to the destination node.

Create a single network segment using a bridge. In this solution, the separate LAN segments are bridged together to create a single network segment. With a single network segment, neighboring nodes on separate LAN segments send packets directly to each other and bridges forward the packets to the destination node on the appropriate LAN segment.

Windows XP Network Bridge

Windows XP includes the Network Bridge, a feature of the Network Connections folder that allows a computer with multiple network adapters installed to act as a bridge, connecting multiple LAN segments together to form a single network segment.

With the Network Bridge, there is no need to purchase an additional hardware-based bridge device. However, the computer running Windows XP must have network adapters installed for all the LAN segments that it is connecting together.

How to Manage Bridged Connections

To bridge LAN segments of the connections together, hold down the Ctrl key and click all the connections that correspond to all the LAN segments you want to bridge together. Then, right-click one of the selected Local Area Connection objects and click Bridge Connections

Types of Networking Connections Supported for Bridging

The Network Bridge supports all networking technologies whose device driver installed in Windows XP advertises itself as Ethernet. This includes the following types of networking technologies commonly used in home networks:
Ethernet (10 Mbps, 100 Mbps, and Gigabit Ethernet).
IEEE 802.11b wireless (also known as Wi-Fi).
Phoneline-based connections.

Additionally, the Network Bridge supports connections using IEEE 1394.

How it Works

To create a single network segment from multiple LAN segments, the Windows XP Network Bridge uses the following technologies:
Layer 2 bridging.
Layer 3 bridging.

Layer 2 Bridging

Layer 2 bridging in the Network Bridge is an implementation of transparent bridging. With transparent bridging, the Network Bridge places the network adapters of the bridge in a special listening mode known as promiscuous mode. In promiscuous mode, the network adapter processes all frames received. Normally, the network adapter only processes specific frames received.

By processing all frames received on all interfaces, the Network Bridge learns which nodes are on which LAN segments by tracking the source address of received frames. The Network Bridge maintains a table of node addresses and the adapter from which the node is reachable. When a frame is received, its destination address is checked against the bridge table and if found, is forwarded without change to the LAN segment that contains the node with the destination address. If the destination address is not found, the frame is copied out of all adapters except the adapter from which the frame was received, an operation known as flooding. All broadcast and multicast traffic is flooded.

The end result of the Network Bridge"s operation is that nodes on separate LAN segments can send frames directly to each other while broadcast and multicast traffic is received by every node. These are the same conditions that exist when all the nodes of the network segment are connected to the same LAN segment.Thus, the Network Bridge transparently connects multiple LAN segments and makes it logically appear as the same LAN segment.

The flooding operation of transparent bridges can cause problems when multiple bridges are configured to form a loop. One problem is a forwarding storm where a frame with an unknown destination address is forwarded endlessly between bridges. To prevent these problems, the Network Bridge implements the industry standard IEEE 802.1D Spanning Tree Algorithm (STA) to determine which network adapters on the bridges can forward frames. The result of the STA is that bridges automatically configure themselves so that you have a loop-free bridged environment at all times. There is no configuration for STA for the Network Bridge, it is enabled by default and is self-configuring.

Layer 3 Bridging

For network adapters that do not support promiscuous mode or network technologies that do not support a broadcast-based transmission method, the Network Bridge acts as a Layer 3 bridge. With Layer 3 bridging, TCP/IP hosts on different LAN segments are transparently connected by the bridge computer.

Layer 3 bridging differs from Layer 2 bridging because the frame is changed as it is forwarded by the bridge computer. Layer 3 bridging differs from routing because a Layer-3 forwarding table, not a routing table, is used for the forwarding decision.

For Layer 3 bridging, the Network Bridge also provides special handing of DHCP packets so that nodes on Layer 3-bridged LAN segments can obtain a DHCP configuration from an ICS computer.

Introduction

Network Bridge is a new feature of Windows XP that uses Layer 2 and Layer 3 bridging to transparently combine multiple LAN segments to form a single network segment. A LAN segment is a collection of network nodes on the same Data Link layer link. For example, all of the computers that are connected to the same Ethernet hub comprise a LAN segment. A network segment is a collection of network nodes that share the same Network layer address. For example, a TCP/IP network segment is a subnet. All nodes on the same TCP/IP subnet share the same IP network identifier.

Layer 3 bridging

Layer 3 bridging is used if the network adapter does not support promiscuous mode. Layer 3 bridging does not require any special network adapter functionality. Layer 3 bridging only works for TCP/IP traffic. For broadcast and multicast IP traffic, a packet that is received by the Network Bridge is retransmitted out through all ports except the port on which the packet was received.

For unicast traffic, Layer 3 bridging is based on the Address Resolution Protocol (ARP). ARP is used by TCP/IP nodes to resolve the MAC address that corresponds to the next-hop address of an outbound IP packet. If the destination of the outbound IP packet is on the local subnet, the next-hop address is the destination address and ARP is used to resolve the MAC address of the destination node. If the destination of the outbound IP packet is not on the local subnet, the next-hop address is the default gateway address and ARP is used to resolve the MAC address of the default gateway (assuming that this is a typical host configuration).

A Network Bridge acts as an ARP proxy, answering ARP requests from a node on one LAN segment on behalf of a node on another segment and transferring unicast packets between nodes on different LAN segments.

The Network Bridge (Node B) connects Segments 1 and 2 and has a single IP address (IP_B). When Node A sends an IP packet to Node C, it first sends an ARP request that contains Node A"s MAC address (MAC_A), Node A"s IP address (IP_A), and Node C"s IP address (IP_C). Node B receives the broadcast ARP request and checks its Layer 3 forwarding table.

The Layer 3 forwarding table is maintained by the Network Bridge and contains entries with the following information: node IP address, node MAC address, and port (the network adapter on which the node is located). An entry for the sender of an ARP request in the Layer 3 forwarding table is created when it is received. Entries are refreshed upon each use. Unused entries are timed out after 5 minutes. In this example, the Network Bridge either creates or refreshes the following entry in the Layer 3 forwarding table: IP_A, MAC_A, Port 1.

If an entry for the target IP address of the ARP request is found in the Layer 3 forwarding table and is on a different port, the Network Bridge responds to the ARP request with an ARP reply, which contains its own MAC address for the port on which the request was received. If an entry for the target IP address of the ARP request is found in the Layer 3 forwarding table and is on the same port, the sending and destination nodes are on the same LAN segment and the ARP Request is ignored.

In this example, the Network Bridge unicasts an ARP reply to Node A with the following information: Node B's MAC address on port 1 (MAC_B_1), Node C's IP address (IP_C), Node A's MAC address, and Node A's IP address (IP_A). When Node A sends packets to Node C's IP address, they are sent to Node B's MAC address on port 1 (MAC_B_1).

If the destination IP address of a received unicast IP packet is assigned to the Network Bridge, it is passed to IP and upper layers for processing. If the destination IP address of a received unicast IP packet is not assigned to the Network Bridge, it must determine which of the following is true:
1.The destination is a node on another LAN segment of the local subnet.

2.The destination is a node on another subnet and the packet is being forwarded to the Network Bridge because it is an IP router.

3.The destination is a node on another subnet and the packet is being forwarded to a router on another LAN segment of the local subnet.

The Network Bridge uses the following algorithm to determine which of these cases is true:
Look up the destination address in the Layer 3 forwarding table.
If an entry is found, forward the packet to the destination (Case 1 above).
If an entry is not found, use the IP routing table to determine the next-hop address for the destination address.
If a next-hop address is determined, look up the next-hop address in the Layer 3 forwarding table.
If an entry for the next-hop address is found, forward the packet to the node that corresponds to the next-hop address (Case 3 above).
If an entry for the next-hop address is not found, send the packet to IP and upper layers for processing (Case 2 above).
If a next-hop address is not determined, send the packet to IP and upper layers for processing (Case 2 above).

In this example, Node B receives the packet that is forwarded by Node A to the destination IP address (IP_C). Because the Layer 3 forwarding table contains an entry for Node C (the entry IP_C, MAC_C, Port 2), the Network Bridge forwards the packet from the MAC address MAC_B_2 (which corresponds to port 2 on the Network Bridge) to the MAC address MAC_C .

If the Network Bridge receives an ARP request and the target IP address is not found in the Layer 3 forwarding table, the Network Bridge stores the contents of the ARP request in an ARP Pending table. The Network Bridge then sends its own ARP request message out all ports except the port on which the original ARP request was received. When a unicast ARP reply to the Network Bridge's request is received, it is matched to the entry in the ARP Pending table. The Network Bridge then sends a unicast ARP reply to the original requestor. The entry in the ARP Pending table is eventually time out.

Windows XP Home Networking: Building Network Bridges

network bridge, this is a feature of the Network Connections folder that allows a computer with multiple network adapters to act as a bridge, connecting different local area network (LAN) segments. A Network Bridge is required, for example, to connect different networking technologies such as a wired Ethernet segment and a wireless 802.11b segment.

You don't need to be connecting two networks to get value from bridging. Bridging is also useful for connecting a laptop with a built in 802.11b (wireless) card to a cabled network when you don't have a wireless access point-add a wireless card to any other computer on your network and it can bridge the wireless onto the cabled network.

Bridging Requirements

To connect several computers, install a network card in each and run CAT5 network cabling to connect all of them to a hub (and thus each other.) The computer that will be used for bridging will need both a regular network card for the cabled connection and a wireless network card that will make the connection to the wireless access point (WAP) or gateway on the second network-in our case a Linksys WAP-11 connected to the main upstairs network. When the two networks have been bridged, the downstairs machines will be assigned IP addresses by the DHCP server and will have access to the Internet.

One fine day, I needed to connect a virtual machine from VirtualBox to the Internet via a WiFi connection. Of course, I tried to connect in the already tested way. But no! Whig to you! Do not think that the previous way of creating a bridge for the VirtualBox virtual machine does not work, it certainly does. I just did not immediately guess that for the created connection (bridge) you also need to enter the password for accessing the WiFi gateway, because the network is closed. But I figured it out after I connected using the method described below. And so let's get started! ;)

Let's start by configuring the network interface in virtual box. Highlight the installed virtual machine and on the "Details" tab, click "Network".

    As in the figure below, we run through the items marked with checkmarks. Naturally, we are interested in:
  1. Network Bridge
  2. .
  3. The name of the physical interface through which we connect to the network.
  4. Adapter type, I usually choose PCnet-Fast III (less identification problem, but see for yourself).
  5. Don't forget to tick "enable network adapter" And "cable connected".

We press "OK"

We make sure that the "VirtualBox Bridged Networking Driver" component is enabled on the "Network" tab (After all, you installed all the VirtualBox components when installing the program :)) ? Yes, do not forget to check the same component for the virtual adapter!) and confidently go to the "Access" tab.

Check the box "Allow other network users to use this computer's Internet connection". Further "OK".

We get a warning, see a little higher. We remember the IP specified there (it will be needed for the control check below). And boldly speak "Yes". By the way, I almost forgot, before that I temporarily disabled all unused network interfaces, well, so as not to get in the way. :)

The next step is to check the "Status" of the "VirtualBox" network connection.

See picture below.

We make sure that the IP and subnet mask are received correctly.

Back to settings virtual box. Changing any settings in virtual box possible only when the virtual machine is turned off (not to be confused with the program virtual box :)).

On the network settings tab virtual box select the name of our network adapter and click "Screwdriver".

Once again, we make sure that the IP and subnet masks are correct. Well, just in case. Even though we came here for the tab" DHCP server".

Among ordinary users, there are not so many who know that the installed network equipment (network cards on computers and routers) allows you to create bridge connections. What it is, what it is for, and how to set it up, will be discussed further. And let's start with what is the point of creating and configuring such a connection.

What is a network bridge and why is it needed

As you know, two types of connection can be used to create network connections and access the Internet - wired and wireless. The first type provides a more stable connection for each terminal connected to the network. But the second involves connecting several machines at once by connecting computers to a network via Wi-Fi (you can even create a virtual network via the Internet).

Network Bridge, in fact, is a tool that allows you to combine both connections into one. What is it for? Suppose the user's computer is connected to one network via an Ethernet network card, and to the second via Wi-Fi. It is clear that the networks do not touch each other (in a wired network, when trying to identify a terminal with a wireless connection, you can only see a router). When creating a bridge, this problem is eliminated quite simply, plus - the stability of the connection is increased.

The same applies to cases where the network equipment is a single-port modem, to which only one computer can be connected. And what about the rest of the terminals? In this case, they must be connected through the main computer, which will act as a host machine. The following steps will cover the steps for two computers. If there are more of them, accordingly, it will be necessary to configure it on all client machines.

Creating a bridge on the host terminal

Now let's move on to practical actions. I immediately want to please all users who are not particularly versed in network settings, that there is nothing particularly complicated here, and the creation and configuration of a network bridge is done within a couple of minutes. If two computers are used, they must be connected by a crossover cable with RJ-45 connectors that plug into network cards.

So, in Windows, a network bridge can be configured through the standard section of networks and the Internet ("Network Control Center"), which is located in the "Control Panel". In it, you need to click on the hyperlink for changing the properties of the adapter, after which the window will display the two types of connections that were indicated above.

Now both icons must be selected (for example, with a normal click while holding down the Shift key) and through RMB select the "Bridge settings" item.

In just a second, the Network Bridge icon will appear in network connections. In theory, on a client machine, an icon will appear in the system tray only if the system provides for automatic assignment of parameters. Otherwise, the bridge icon will have a cross, indicating that the network bridge will need to be configured manually.

Address verification

The bridge has been created and, in theory, works, but computers still cannot interact with each other. On the host terminal, open a command prompt and enter the ipconfig/all command. A window will appear with a lot of information.

In the options provided, find and write down the IP and DNS addresses. The Default Gateway does not need to be remembered because it always has the same value (255.255.255.0).

IPv4 protocol settings on the client machine

At the next stage, to connect the network bridge on the client terminal, you need to configure the IPv4 protocol options.

To do this, through the connection properties, enter the protocol parameters and write down the static IP that you learned on the main machine, increasing the last digit or number by one. In other words, if the address at the end was, for example, a deuce, enter a three.

DNS options

Bridged network devices will not work without specifying DNS server addresses.

If automatic receipt of addresses is specified, deactivate it and for the preferred server, write the combination received on the host terminal, and for the alternative - the same address, but with the last number or digit increased by one, as was done for the IP address. After completing the settings, check the box next to the option to confirm the settings on exit and click "OK". On this, the creation of the bridge can be considered completed.

Note: Please note that if the connection for DNS addresses fails, the use of free configurations, for example, from Google, is not provided, since only strictly defined combinations should be used when creating such a connection.

Setting up a network bridge in a VirtualBox virtual machine

In the case of use, creating and configuring a bridge looks even easier. In this case, you can use several virtual adapters. In the program itself, you must first select the created virtual machine (menu on the left), and in the right window click on the network section.

In the properties window, the first step is to specify the type of adapter (it is best to choose PCnet-Fast III, since it will be less troublesome to configure). It is also mandatory to activate the fields for enabling the adapter itself and connecting the cable.

Now in the network connections of the “Control Panel” via RMB on a wireless connection, go to the properties and make sure that the VirtualBox Bridged Networking Driver adapter has appeared in the list. On the access tab, both fields must be activated (permission to connect to the Internet and control sharing for other computers). In the warning, remember the IP address and click "OK". Now, through RMB on the VirtualBox connection, select and compare the source and existing IP. If they match, then everything is done correctly and the bridge is working normally.

Now you need to go to the settings in the program itself (with the virtual machine deactivated) in the adapter menu, by clicking on the button marked with a screwdriver icon, once again make sure that the settings are correct. Further, with a static IP on the DHCP tab, make sure that the server is disabled. Upon completion, just in case, you can check the ping by typing ping at the command line and separating the IP of the virtual machine with a space. If the packet exchange has started, then everything is in order. In theory, the address of the guest terminal in the last numbers will have a value from the range 1-254 and correspond to the real address of the network adapter.

Brief summary

That, in fact, is all that concerns the creation and configuration of a bridge connection. As an afterword, I would like to advise you to be as careful as possible when entering addresses, since only one incorrectly entered number will nullify all your efforts. Other than that, there shouldn't be much of a problem. If for some reason you need to get rid of the created connection, you can either deactivate it in the adapter properties section or completely delete it using the RMB menu items for this.