I bought a new switch SG108E, So i can use pi4 without usb-ethenet adapter.
Please help me config SG108E switch to use with pi4 only with single lan cable.
you only need one single lan cable to to run a RPi .... ?
yes this is what i want to do
connect an ethernet cable between the switch and the Rpi, done !?
no, someone here mentioned you can use sg108e switch to connect with ISP modem and also use it as lan switch connected with pi4 without usb ethernet adapter
why would you need an usb adapter, it already have a port ?
what are you trying to achieve ?
pi4 as a router connected with switch and modem via lan port
The concept is to tag VLANs on the single cable between the switch and the Pi. This is also known as Router On a Stick or "one armed" operation. Here VLAN 1 will be LAN devices and VLAN 2 will be the path to the modem.
In OpenWrt it is straightforward to change the physical setting on the LAN network to eth0.1 instead of eth0. This means port 0 VLAN 1. Then create a wan network with physical device eth0.2. Naming the wan network exactly 'wan' (lower case) will have the firewall already set up. No network should have physical device eth0 with no VLAN number.
Before changing Ethernet settings it would be good to start up a wifi AP on lan and log in via wifi, so you always have a way to log in even if the Ethernet is not right.
Then it becomes about configuring the SG-108E, which really isn't in the scope of this forum. But a few pointers are:
- Update to the latest TP-Link firmware before starting.
- Do not use the DHCP client, set the switch to a static IP on your LAN.
- Go to the VLAN-802.1Q page and enable 802.1Q, and configure two VLANs.
- The port connected to the Pi is tagged in both VLAN 1 and 2.
- The port connected to the modem is untagged in VLAN 2 and not member of VLAN 1.
- The other 6 ports will be LAN devices, they are untagged in VLAN 1 and not member of VLAN 2.
- Then go to the PVID page and change the PVID of the modem port to 2.
The network in the video has a fiber service with an ONT which requires packets on the Ethernet cable to be tagged with VLAN 10. As the video shows this situation is readily accomadated, but it is slightly different than using a cable modem.
I assume you have a cable modem instead. Cable modems send and receive untagged packets. The modem expects to work as if it is connected to a dedicated port on an ordinary router.
The switch will apply a tag of 2 to untagged packets received on the modem port (because that port's PVID is 2) and then switch them to any other ports that are members of VLAN 2, in this case the only other one is the Pi port. When the Pi sends a packet destined for the Internet, it has a tag of 2. The switch reads this tag to know where to send the packet. But it will remove the tag on the way out the port to the modem.
I have a vdsl modem. Is it same for vdsl modem? I used vlan 10 as mentioned in the video.
It depends on how the modem is configured. If the Internet works with the modem plugged into the WAN port of an ordinary router with stock firmware, it is using untagged packets.
Tagged packets are usually an issue when the ISP also supplies a router to the customer. This is almost always the case with fiber and often with VDSL. The tagging is used for separate services like TV service. To replace the ISP-supplied router with your own, it is necessary to understand and match the tagging required.
If you're going to strip the tags off before sending to the modem, the VLAN number is not important, as it is used only internally between the Pi and the switch. If you did have to match the tag number expected by the modem / ONT, then you have to use the same tag number throughout. Even expensive switches can't re-write or translate tag numbers between ports.
modem is in bridge mode with pi4 and i am dialing pppoe connection from pi4. And yes there is vlan id in modem settings for bridge interface.
That setting means to take untagged packets from the Ethernet port and tag them before they go over the DSL line.
why RxBadPkt
is so high for the port with which i have connected pi4?
port number 7
is there something wrong with my config or there is a fault in the cable?
Port Status Link Status TxGoodPkt TxBadPkt RxGoodPkt RxBadPkt
Port 1 Enabled Link Down 0 0 0 0
Port 2 Enabled Link Down 0 0 0 0
Port 3 Enabled Link Down 34494633 0 33783775 0
Port 4 Enabled Link Down 0 0 0 0
Port 5 Enabled Link Down 10244674 0 19794186 45
Port 6 Enabled Link Down 0 0 0 0
Port 7 Enabled 1000M Full 208711459 0 204695888 32265444
Port 8 Enabled 100M Full 80388966 0 128938581 0
Does port number 7 have VLAN tags? Apparently it's a quirk of the TP-Link firmware/UI that it counts tagged packets as 'RxBadPkt' for the purposes of that table. Just ignore it, unless port 7 doesn't have any VLAN tags or it's having an actual impact on the connection.
yes it is part of two vlans 1-7 and 7-8
port 7 is part of two vlans and also tagged for 7-8