View previous topic :: View next topic |
Author |
Message |
Fog_Watch Apprentice
Joined: 24 Jul 2006 Posts: 267 Location: Utility Muffin Research Kitchen
|
Posted: Fri Aug 20, 2021 11:38 am Post subject: Would a bridge obviate the need for lots of routes? SOLVED |
|
|
Hello,
I want to be able to ping B and C from A. C doesn't need to know about B. I know how to do this by putting C on a different subnet. Is there a way to achieve this though with a bridge or something on B so that I don't have to use lots of yucky route statements? Even better, how could I arrange for C to obtain its IP address from A's dhcpd?
Code: | ,'''''''''''''''''''''''''''''''''''''''''''''''''''|
| ............ |
| |Computer A|_ |
| `----------' `._ |
| ,-' `-. |
| ,-' `-._ |
| ,-' `-. |
| .....:...... ,----`------ |
| |Computer B| |Computer D| |
| `----+-----' `----------' |
| | |
| \ |
| | |
| | |
| ......\..... |
| |Computer C| |
| `----------' |
"---------------------------------------------------' |
Last edited by Fog_Watch on Tue Aug 24, 2021 10:28 am; edited 1 time in total |
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3129
|
Posted: Fri Aug 20, 2021 12:48 pm Post subject: |
|
|
You can bridge 2 B's interfaces and it will allow both, B and C to be directly accessed from A and even get addresses from A's DHCP. Bridges are transparent to the traffic, so it is indeed an easy way to configure what you described there.
Note: in this case, B should assign IP address to the bridge interface and not to any of the physical devices.
Alternatively, you can deploy a bunch of routing daemons. E.g. bird. It is in portage, and it can negotiate site-local routes via OSPF. I'm going to try this one in near future, on a slightly more complex network.
Yeah, there will be quite a few routes, but at least they will flock together reducing the total number of rules to maintain manually. |
|
Back to top |
|
|
Fog_Watch Apprentice
Joined: 24 Jul 2006 Posts: 267 Location: Utility Muffin Research Kitchen
|
Posted: Tue Aug 24, 2021 4:37 am Post subject: |
|
|
Thanks szatox
The following works, including dhcp:
Code: | $ rc-update show | grep -F net.
net.br0 | default |
Code: | $ egrep -v '^#|^##' /etc/conf.d/net
config_net0="null"
config_net1="null"
bridge_br0="net0 net1"
mac_br0="1c:1b:aa:dd:cc:38"
config_br0="dhcp"
rc_net_br0_provide="net"
bridge_forward_delay_br0=0
bridge_hello_time_br0=1000
|
Is there a way of transferring this to /etc/dhcpcd.conf thereby not using netifrc? |
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3129
|
Posted: Tue Aug 24, 2021 8:56 am Post subject: |
|
|
I don't think so. Dhcpcd and brigde are 2 very different tools covering different aspects of networking.
Your config looks perfectly fine the way it is.
If you want to start dhcpcd as a service instead of as a module from netifrc, I think you could do that by setting null IP on the bridge and adding net.br0 to boot runlevel instead of default, and then dhcpcd to default runlevel.
Depending on how smart dhcpcd is with slaves, this may require masking net0 and net1 in dhcpcd config, in which case it would probably be a better idea to pull net.br0 as a dhcpcd's dependency instead of adding it to boot too. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|