I have a need to connect two laptops one of which has a WWAN connection to the Internet, and the only device I have available is an OpenWrt router with four ports.
Can I turn this router into a simple switch?
I have a need to connect two laptops one of which has a WWAN connection to the Internet, and the only device I have available is an OpenWrt router with four ports.
Can I turn this router into a simple switch?
Sure. It's very similar to the dumb AP configuration -- assuming that the uplink is wired. Is that the case?
I was wondering if I could create a VLAN combining LAN1 and LAN2...
Don't know much (anything, really) about VLANs, but this could be a good opportunity to learn.
Yes, I do this with an old Archer 4-port device. Functions as a smart switch. The link @psherman posted helps explain this.
In my case ports lan1-lan3 are on VLAN 10 and port lan4 is on VLAN 4. The wan port is the uplink port which is connected to a smart switch which is in turn connected to my router/firewall.
I'm basically wanting to link port 1 and port 2 without the router playing any part.
Can I do this simply by editing /etc/config/network ?
I'm having problems with the GUI.
Am I right in thinking that I need to edit the 'config switch_vlan' section?
Yes, it can be done that way.
Probably, yes.
The best bet is the following:
/etc/config/network
fileFrom there we can advise on the specifics of the edits required. Should be really simple.
Why not connect them with an Ethernet cable? Bridge the WWAN to eth and set a static IP for both eth cards
I don't believe this is a technically proper solution -- you cannot (and should not) bridge a wwan in this way.
Further, it is not likely the solution that the OP is currently looking for, based on their most recent reply.
Please explain, why "cannot"?
I didn't mean to literally bridge them but to share the connection somehow, route etc
A wifi uplink/client (sta mode) connection cannot be directly bridged to ethernet or a wifi AP mode setup. This won't work because of the way that wifi was designed. To achieve this, you need to use additional methods such as relayd or WDS.
A wwan connection should be associated with its own interface -- no bridge involved. That interface can, in turn, be associated with the wan firewall zone. This enables it to operate as a wan for routing purposes along side (if desired) an ethernet connected wan (or for that matter, a cellular or dsl wan). In this type of situation, the wan will usually (but not always) use masquerading and the lan will operate behind this NAT layer, allowing multiple devices to share the connection.
The OP has asked for something different, though (unless I misunderstood it)... they have an ethernet wan connection and they want to switch that connection through to another port (basically a pass-through) while simultaneously using that connection as the upstream. In this case, we'll put two physical ethernet ports together in a bridge, and associate that bridge with the wan interface. This works for ethernet, but would not be directly possible with wifi.
It will be interesting when OP returns:
Because I read they have a laptop with a wwan to internet and want to share that with another laptop using ethernet probably using W10's built in connection sharing and believe they need a switch to do that and want to dumb down the router part all together. I see nothing that suggests they want wifi as either client or AP.
They mention vlans but I do not understand why it helps if I'm reading it right.
They, probably, could just use one ethernet cable, because most ports auto mdi-x nowadays, and just assign ip settings manually.
This part would be out of scope for OpenWrt insofar as it would be a function of the operating system on that laptop (i.e. Windows/Mac/Linux 'internet connection sharing' type setup). That said, once the wifi network is shared with ethernet from that PC, it is easy enough to setup the OpenWrt router to do whatever is needed with that ethernet connection.
I was thinking a default config on a OpenWrt device with a 4 port switch would provide what is needed with two "lan" ports used.