openssl: bump to 1.1.1j
[librecmc/librecmc.git] / docs / Bridge_Mode.md
1 # Bridge Mode
2
3 A common feature of COTS Wi-Fi routers is to be able to set the router
4 to bridge mode, where the devices stops acting like an IP router
5 (layer 3) and starts acting like an ethernet switch (layer
6 2). LibreCMC does not actually have a bridge mode, but the same effect
7 is achievable with two easy steps.
8
9 1. Add the WAN ethernet port to the LAN bridge interface
10 2. Set the DHCP server to ignore the LAN interface
11
12 ## Adjust the LAN bridge interface
13
14 Go to the Network >> Interfaces page and press the EDIT button next to
15 the LAN Network. Select the Physical Settings tab.
16
17 ![alt text](images/librecmc-default-interfaces.png "LibreCMC default
18  interfaces view")
19
20 Place a checkmark in the box for the "eth0" interface for wan and
21 wan6. (I suppose the interface name might vary amongst different
22 routers.)
23
24 ![alt text](images/librecmc-eth0-added-to-lan.png "Adjustments to
25  LibreCMC interface physical settings")
26
27 You can also check the box for Enable STP if desired. There doesn't
28 seem to be any downside from this, though I suppose it would use a
29 little more CPU cycles and memory. STP is a protocol intended to
30 prevent infinite communication loops from forming in a network of
31 layer 2 switches.
32
33 ## Adjust DHCP server settings
34
35 On the same page, scroll down a little to the DHCP Server section. In
36 the General Setup tab, check the "Ignore interface" box.
37
38 ![alt text](images/librecmc-dhcp-server-ignore-lan.png "Setting
39  LibreCMC DHCP server to ignore LAN interface")
40
41 Save and apply your changes.
42
43 ## Communicating with LibreCMC in "bridge mode"
44
45 Now that the DHCP server is turned off, the next time you connect to
46 the libreCMC device, you will not be able to communicate with it. You
47 must set your connecting device manually to be on the same
48 subnet. Since the default libreCMC LAN IP address is 192.168.10.1/24,
49 it should work to set your connecting device to IP address
50 192.168.10.2/24.On Gnu/Linux systems, the command is usually `ip addr
51 add 192.168.10.2/24 dev eth0` or `dev wlan0` if connecting wirelessly.
52
53 Alternatively, you may set the libreCMC device to receive an IP
54 address from another DHCP server on your network: go to back to the
55 Network >> Interfaces page, press the EDIT button again next to the
56 LAN Network, select the General Setup tab, and switch the Protocol
57 from "Static address" to "DHCP client". (It seems that in LibreCMC,
58 bridging the LAN interface to the WAN port disables the operation of
59 the DHCP client on the WAN interface.) Of course, if you do this, be
60 sure that your DHCP server has reserved a memorable IP address for the
61 LibreCMC device's MAC address, so you don't have trouble finding it.
62
63 ![alt text](images/librecmc-switch-lan-to-dhcp.png)
64
65 ## Advanced
66
67 These adjustments are not required, but they lead to a configuration
68 which will be more consistent and have cleaner logs.
69
70 ### Disabling odhcpd (DHCP daemon)
71
72 In bridge mode, you aren't going to want to serve DHCP out any
73 interface. So you might as well just shut down the whole DHCP
74 server. Log in via SSH, and run the commands:
75
76 ```
77 /etc/init.d/odhcpd stop
78 /etc/init.d/odhcpd disable
79 ```
80
81 ### Delete the WAN(6) interfaces
82
83 From `Network` >> `Interfaces`, you can delete the WAN and WAN6
84 interfaces. See also the "Add a LAN6 interface" section below.
85
86 ### Delete the WAN Firewall Zone
87
88 From `Network` >> `Firewall` you can delete the WAN zone. If you do
89 need a WAN firewall, then you should not be running in bridge mode in
90 the first place.
91
92 ### Add a LAN6 Interface
93
94 If you have IPv6 access, you will want an interface which receives an
95 IPv6 address. From `Network` >> `Interfaces` create a new interface
96 called `LAN6` with `Protocol` set to `DHCPv6 client`.
97
98 You will likely also want to disable `odhcpd` (see above). Otherwise
99 your logs can get filled up with unnecessary IPv6 related messages, as
100 libreCMC tries to act like an IPv6 router. `odhcpd` normally handles
101 DHCPv6 as well as IPv6 Router Advertisements.