Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Post History

66%
+2 −0
Q&A Access host device which bridges a connected device through same eth interface

I got 2 small computers running Linux. One acts as ethernet gadget, connected via USB to the other, the host. I set up a bridge, like so: ip link add name br0 type bridge ip link set dev br0 up...

1 answer  ·  posted 3y ago by sktpin‭  ·  last activity 3y ago by sktpin‭

Question networking
#4: Post edited by user avatar sktpin‭ · 2021-08-11T10:16:52Z (over 3 years ago)
  • I got 2 small computers running Linux.
  • One acts as ethernet gadget, connected via USB to the other, the host.
  • I set up a bridge, like so:
  • ```
  • ip link add name br0 type bridge
  • ip link set dev br0 up
  • ip link set dev eth0 master br0
  • ip link set dev usb0 master br0
  • ```
  • On the gadget, its usb0 interface has 2 IP addresses: the one in the 169.... net that the host also has on its usb0, which I consider the "internal" connection/subnet between the two computers - and the second IP on the gadget is one in the "outside" subnet, which the bridging host is connected to with its eth0 interface.
  • This almost works. Except, when I run the script that sets up the bridge, I cannot connect to the host anymore, e.g. SSH into it with its eth0's own IP address.
  • **Edit**: What's weird is that establishing SSH connections to the host eth0's own IP still **works for a while** (e.g. tens of seconds) after setting up the bridge, but ceases to work then.
  • I found [something here](https://docs.openvswitch.org/en/latest/faq/issues/), indicating that, if eth0 has a bridge to something else, it's not supposed to have an own IP address. The text suggests to add an address to the bridge:
  • ```
  • ip addr flush dev eth0
  • ip addr add 192.168.128.5/24 dev br0
  • ip link set br0 up
  • ```
  • That didn't help, though.
  • The goal is to be able to access both from the outside world (a local network with a bunch more computers), with all thinkable protocols: the host device, as well as the gadget, and bridging seemed like the way.
  • How is this done correctly?
  • I got 2 small computers running Linux.
  • One acts as ethernet gadget, connected via USB to the other, the host.
  • I set up a bridge, like so:
  • ```
  • ip link add name br0 type bridge
  • ip link set dev br0 up
  • ip link set dev eth0 master br0
  • ip link set dev usb0 master br0
  • ```
  • On the gadget, its usb0 interface has 2 IP addresses: the one in the 169.... net that the host also has on its usb0, which I consider the "internal" connection/subnet between the two computers - and the second IP on the gadget is one in the "outside" subnet, which the bridging host is connected to with its eth0 interface.
  • This almost works. Except, when I run the script that sets up the bridge, I cannot connect to the host anymore, e.g. SSH into it with its eth0's own IP address.
  • **Edit**: What's weird is that establishing SSH connections to the host eth0's own IP still **works for a while** (e.g. a few minutes) after setting up the bridge, but ceases to work then.
  • I found [something here](https://docs.openvswitch.org/en/latest/faq/issues/), indicating that, if eth0 has a bridge to something else, it's not supposed to have an own IP address. The text suggests to add an address to the bridge:
  • ```
  • ip addr flush dev eth0
  • ip addr add 192.168.128.5/24 dev br0
  • ip link set br0 up
  • ```
  • That didn't help, though.
  • The goal is to be able to access both from the outside world (a local network with a bunch more computers), with all thinkable protocols: the host device, as well as the gadget, and bridging seemed like the way.
  • How is this done correctly?
#3: Post edited by user avatar sktpin‭ · 2021-08-11T10:08:14Z (over 3 years ago)
  • I got 2 small computers running Linux.
  • One acts as ethernet gadget, connected via USB to the other, the host.
  • I set up a bridge, like so:
  • ```
  • ip link add name br0 type bridge
  • ip link set dev br0 up
  • ip link set dev eth0 master br0
  • ip link set dev usb0 master br0
  • ```
  • On the gadget, its usb0 interface has 2 IP addresses: the one in the 169.... net that the host also has on its usb0, which I consider the "internal" connection/subnet between the two computers - and the second IP on the gadget is one in the "outside" subnet, which the bridging host is connected to with its eth0 interface.
  • This almost works. Except, when I run the script that sets up the bridge, I cannot connect to the host anymore, e.g. SSH into it with its eth0's own IP address.
  • I found [something here](https://docs.openvswitch.org/en/latest/faq/issues/), indicating that, if eth0 has a bridge to something else, it's not supposed to have an own IP address. The text suggests to add an address to the bridge:
  • ```
  • ip addr flush dev eth0
  • ip addr add 192.168.128.5/24 dev br0
  • ip link set br0 up
  • ```
  • That didn't help, though.
  • The goal is to be able to access both from the outside world (a local network with a bunch more computers), with all thinkable protocols: the host device, as well as the gadget, and bridging seemed like the way.
  • How is this done correctly?
  • I got 2 small computers running Linux.
  • One acts as ethernet gadget, connected via USB to the other, the host.
  • I set up a bridge, like so:
  • ```
  • ip link add name br0 type bridge
  • ip link set dev br0 up
  • ip link set dev eth0 master br0
  • ip link set dev usb0 master br0
  • ```
  • On the gadget, its usb0 interface has 2 IP addresses: the one in the 169.... net that the host also has on its usb0, which I consider the "internal" connection/subnet between the two computers - and the second IP on the gadget is one in the "outside" subnet, which the bridging host is connected to with its eth0 interface.
  • This almost works. Except, when I run the script that sets up the bridge, I cannot connect to the host anymore, e.g. SSH into it with its eth0's own IP address.
  • **Edit**: What's weird is that establishing SSH connections to the host eth0's own IP still **works for a while** (e.g. tens of seconds) after setting up the bridge, but ceases to work then.
  • I found [something here](https://docs.openvswitch.org/en/latest/faq/issues/), indicating that, if eth0 has a bridge to something else, it's not supposed to have an own IP address. The text suggests to add an address to the bridge:
  • ```
  • ip addr flush dev eth0
  • ip addr add 192.168.128.5/24 dev br0
  • ip link set br0 up
  • ```
  • That didn't help, though.
  • The goal is to be able to access both from the outside world (a local network with a bunch more computers), with all thinkable protocols: the host device, as well as the gadget, and bridging seemed like the way.
  • How is this done correctly?
#2: Post edited by user avatar sktpin‭ · 2021-08-10T17:23:00Z (over 3 years ago)
  • I got 2 small computers running Linux.
  • One acts as ethernet gadget, connected via USB to the other, the host.
  • I set up a bridge, like so:
  • ```
  • ip link add name br0 type bridge
  • ip link set dev br0 up
  • ip link set dev eth0 master br0
  • ip link set dev usb0 master br0
  • ```
  • On the gadget, its usb0 interface has 2 IP addresses: the one in the 169.... net that the host also has on its usb0, which I consider the "internal" connection/subnet between the two computers - and the second IP on the gadget is one in the "outside" subnet, which the bridging host is connected to with its eth0 interface.
  • This almost works. Except, when I run the script that sets up the bridge, I cannot connect to the host anymore, e.g. SSH into it with its eth0's own IP address.
  • I found [something here](https://docs.openvswitch.org/en/latest/faq/issues/), indicating that, if eth0 has a bridge to something else, it's not supposed to have an own IP addres. The text suggests to add an address to the bridge:
  • ```
  • ip addr flush dev eth0
  • ip addr add 192.168.128.5/24 dev br0
  • ip link set br0 up
  • ```
  • That didn't help, though.
  • The goal is to be able to access both from the outside world (a local network with a bunch more computers), with all thinkable protocols: the host device, as well as the gadget, and bridging seemed like the way.
  • How is this done correctly?
  • I got 2 small computers running Linux.
  • One acts as ethernet gadget, connected via USB to the other, the host.
  • I set up a bridge, like so:
  • ```
  • ip link add name br0 type bridge
  • ip link set dev br0 up
  • ip link set dev eth0 master br0
  • ip link set dev usb0 master br0
  • ```
  • On the gadget, its usb0 interface has 2 IP addresses: the one in the 169.... net that the host also has on its usb0, which I consider the "internal" connection/subnet between the two computers - and the second IP on the gadget is one in the "outside" subnet, which the bridging host is connected to with its eth0 interface.
  • This almost works. Except, when I run the script that sets up the bridge, I cannot connect to the host anymore, e.g. SSH into it with its eth0's own IP address.
  • I found [something here](https://docs.openvswitch.org/en/latest/faq/issues/), indicating that, if eth0 has a bridge to something else, it's not supposed to have an own IP address. The text suggests to add an address to the bridge:
  • ```
  • ip addr flush dev eth0
  • ip addr add 192.168.128.5/24 dev br0
  • ip link set br0 up
  • ```
  • That didn't help, though.
  • The goal is to be able to access both from the outside world (a local network with a bunch more computers), with all thinkable protocols: the host device, as well as the gadget, and bridging seemed like the way.
  • How is this done correctly?
#1: Initial revision by user avatar sktpin‭ · 2021-08-10T17:22:15Z (over 3 years ago)
Access host device which bridges a connected device through same eth interface
I got 2 small computers running Linux.
One acts as ethernet gadget, connected via USB to the other, the host.

I set up a bridge, like so:

```
ip link add name br0 type bridge
ip link set dev br0 up
ip link set dev eth0 master br0
ip link set dev usb0 master br0
```

On the gadget, its usb0 interface has 2 IP addresses: the one in the 169.... net that the host also has on its usb0, which I consider the "internal" connection/subnet between the two computers - and the second IP on the gadget is one in the "outside" subnet, which the bridging host is connected to with its eth0 interface.

This almost works. Except, when I run the script that sets up the bridge, I cannot connect to the host anymore, e.g. SSH into it with its eth0's own IP address.

I found [something here](https://docs.openvswitch.org/en/latest/faq/issues/), indicating that, if eth0 has a bridge to something else, it's not supposed to have an own IP addres. The text suggests to add an address to the bridge:

```
ip addr flush dev eth0
ip addr add 192.168.128.5/24 dev br0
ip link set br0 up
```

That didn't help, though.

The goal is to be able to access both from the outside world (a local network with a bunch more computers), with all thinkable protocols: the host device, as well as the gadget, and bridging seemed like the way.

How is this done correctly?