Bpi-r3 isolation wan and lan eth

Hy.

I created a bridge with all lan ports. i used dnsmasq for the DHCP server on my bpi.

when i boot without using the wan rj45 port, the devices plugged in the four lan rj45 get an ip address in the good ip range, thanks to dnsmasq.

But when i used the wan rj45 port ( for example, plugged in my Livebox) the devices plugged in the four lan rj45 get an ip by the wan rj45 port’s device .

From the start of the boot, i can see my computer plugged on the lan2 for example, get an ip from my Livebox.

Is possible to ‘isolate’ the wan rj45 from the four lan rj45?

Here the interface configuration for the bridge :

iface eth0 inet static
	address 10.0.0.1
	netmask 255.255.255.0

iface lan0 inet static
	address 10.0.0.3
	netmask 255.255.255.0
	gateway 10.0.0.1

	hwaddress ether 00:11:22:33:44:50

iface lan1 inet static
	address 10.0.0.4
	netmask 255.255.255.0
	gateway 10.0.0.1

	hwaddress ether 00:11:22:33:44:51

iface lan2 inet static
	address 10.0.0.5
	netmask 255.255.255.0
	gateway 10.0.0.1

	hwaddress ether 00:11:22:33:44:52

iface lan3 inet static
	address 10.0.0.6
	netmask 255.255.255.0
	gateway 10.0.0.1

	hwaddress ether 00:11:22:33:44:53

iface br0 inet static
	address 10.0.0.2
	netmask 255.255.255.0
	gateway 10.0.0.1

iface wan inet dhcp
	udhcpc_opts -t 7 &

And here, the script launched on the boot, which manage the interfaces of the Bridge

	echo 'ifup interfaces Lan sans sfp lan'

	echo 'Creation bridge'
	sudo brctl addbr br0;
	result=$?
	if [ "$result" != "0" ];then
		echo 'Echec creation bridge';
		sudo bash $historisation_script 'ifup lan' 'Erreur création bridge' 'code erreur : '$result;
		exit 2;
	fi

	echo 'Ajout interfaces au bridge'
	sudo brctl addif br0 lan0 lan1 lan2 lan3;
	result=$?
	if [ "$result" != "0" ];then
		echo 'Echec ajout interfaces au bridges';
		sudo bash $historisation_script 'ifup lan' 'Erreur ajout interfaces au bridge' 'code erreur : '$result;
		exit 2;
	fi

	echo 'Reveil bridge'
	sudo ifup -f br0;
	result=$?
	if [ "$result" != "0" ];then
		echo 'Echec reveil interfaces lan';
		sudo bash $historisation_script 'ifup lan' 'Echec reveil interfaces lan' 'code erreur : '$result;
		exit 2;
	fi

	echo "Reveil les interfaces lan filaires"
	sudo ifup -f lan0;
	sudo ifup -f lan1;
	sudo ifup -f lan2;
	sudo ifup -f lan3;
	sudo ifup -f lan4;

	echo 'Reveil eth0'
	sudo ifup -f eth0;

Thanks by advance for your help :slight_smile:

Do not set ip on gmac where switch is connected.

And if you bridge lan-ports,you have to set ip to the bridge and not the lan-ports.

Gateway needs to be nexthop,not same device

Hy Thank you to aswer me :slight_smile:

Modify my interfaces conf like this :

#bridge

iface eth0 inet manual

iface lan0 inet manual

iface lan1 inet manual

iface lan2 inet manual

iface lan3 inet manual

iface br0 inet static
        address 10.0.0.2
        netmask 255.255.255.0  

is it good ?

Yes,maybe you need tweak for eth0 to be up. You can add bridge options (e.g. which interfaces)

And wan can be added to,but option above looks wrong

Hy :slight_smile:

When i put the bridge options ont he interfaces files, there aren’t applied :frowning: I don’t know why.

I have another problem please, with the two sfp.

When i put a module sfp ( rj45 or gpon onu for example) . It is recognized ( can see informations with ethtool)

But the network by the sfp doesn’t work.

For Example, i put the rj45 sfp and put the option dhcp for the sfp wan. It don’t take an ip. :frowning:

Try withe the rj45 wan with dhcp option,it’s ok.

I have tried with kernel 6.0 and 6.1

Which distribution and which exactly kernel do you use? Some systems like debian (buster +) do not use interfaces file anymore. To have bridge options in interfaces working it needs additional handling which is not there in busybox/buildroot.

I’m not sure i tested dhcp on sfps yet,have always set ip manually

I use your kernel 6.1-r3. And for the Os, i build from buildroot with busybox. The fact taht the bridge can’t be in the interface’s file ain’t a problem :slight_smile:

I have the problem for the two sfp. Module recognized but the network doesn’t pass. I have tested wit he rj45 sfp and a gpon onu.

The interfaces wan aren’t in a bridge,can i do like it? is there a kind of switch between wan rj45 and wan sfp?

For the sfp rj45 i have this error :

[  230.252297] mtk_soc_eth 15100000.ethernet eth1: validation with support 00000000,00000000,00000000 failed: -EINVAL
# [  230.262788] sfp sfp-1: sfp_add_phy failed: -EINVAL

My sfp working without problems.please post full bootlog and maybe try to reduce/increase the i2c speed of the right sfp-i2c in devicetree

To modify the i2c speed of the sfp, i must add a ligne with clock-frequency to the sfp,isn’t it?

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 6.1.0-rc1-diagbox (root@workstation) (aarch64-linux-gnu-gcc (Linaro GCC 7.5-2019.12) 7.5.0, GNU ld (Linaro_Binutils-2019.12) 2.28.2.20170706) #2 SMP Fri Nov 11 23:30:40 CET 2022
[    0.000000] Machine model: Bananapi BPI-R3 (sdmmc)
[    0.000000] earlycon: uart8250 at MMIO32 0x0000000011002000 (options '')
[    0.000000] printk: bootconsole [uart8250] enabled
[    0.000000] efi: UEFI not found.
[    0.000000] OF: fdt: Reserved memory: failed to reserve memory for node 'wmcpu-reserved@4fc00000': base 0x000000004fc00000, size 1 MiB
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000040000000-0x00000000bfffffff]
[    0.000000]   DMA32    empty
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000040000000-0x0000000042ffffff]
[    0.000000]   node   0: [mem 0x0000000043000000-0x000000004302ffff]
[    0.000000]   node   0: [mem 0x0000000043030000-0x00000000bfffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x00000000bfffffff]
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.1 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: MIGRATE_INFO_TYPE not supported.
[    0.000000] psci: SMC Calling Convention v1.2
[    0.000000] percpu: Embedded 27 pages/cpu s71144 r8192 d31256 u110592
[    0.000000] pcpu-alloc: s71144 r8192 d31256 u110592 alloc=27*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: detected: GIC system register CPU interface
[    0.000000] CPU features: detected: ARM erratum 845719
[    0.000000] alternatives: applying boot alternatives
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 516096
[    0.000000] Kernel command line: board=DiagBox earlycon=uart8250,mmio32,0x11002000 debug=7 initrd=0x48000000,550M
[    0.000000] Unknown kernel command line parameters "board=DiagBox", will be passed to user space.
[    0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes, linear)
[    0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 1469168K/2097152K available (13376K kernel code, 2194K rwdata, 3828K rodata, 4032K init, 421K bss, 627984K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] trace event string verifier disabled
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU event tracing is enabled.
[    0.000000]  Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] GICv3: GIC: Using split EOI/Deactivate mode
[    0.000000] GICv3: 640 SPIs implemented
[    0.000000] GICv3: 0 Extended SPIs implemented
[    0.000000] Root IRQ handler: gic_handle_irq
[    0.000000] GICv3: GICv3 features: 16 PPIs
[    0.000000] GICv3: CPU0: found redistributor 0 region 0:0x000000000c080000
[    0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention.
[    0.000000] arch_timer: cp15 timer(s) running at 13.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x2ff89eacb, max_idle_ns: 440795202429 ns
[    0.000000] sched_clock: 56 bits at 13MHz, resolution 76ns, wraps every 4398046511101ns
[    0.008281] Console: colour dummy device 80x25
[    0.012744] printk: console [tty0] enabled
[    0.016858] printk: bootconsole [uart8250] disabled
[    0.021785] Calibrating delay loop (skipped), value calculated using timer frequency.. 26.00 BogoMIPS (lpj=130000)
[    0.021798] pid_max: default: 32768 minimum: 301
[    0.021891] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.021906] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.022481] cacheinfo: Unable to detect cache hierarchy for CPU 0
[    0.022778] cblist_init_generic: Setting adjustable number of callback queues.
[    0.022789] cblist_init_generic: Setting shift to 2 and lim to 1.
[    0.022886] rcu: Hierarchical SRCU implementation.
[    0.022891] rcu:     Max phase no-delay instances is 1000.
[    0.023337] EFI services will not be available.
[    0.023492] smp: Bringing up secondary CPUs ...
[    0.023808] Detected VIPT I-cache on CPU1
[    0.023861] cacheinfo: Unable to detect cache hierarchy for CPU 1
[    0.023869] GICv3: CPU1: found redistributor 1 region 0:0x000000000c0a0000
[    0.023902] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[    0.024234] Detected VIPT I-cache on CPU2
[    0.024271] cacheinfo: Unable to detect cache hierarchy for CPU 2
[    0.024276] GICv3: CPU2: found redistributor 2 region 0:0x000000000c0c0000
[    0.024291] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[    0.024563] Detected VIPT I-cache on CPU3
[    0.024596] cacheinfo: Unable to detect cache hierarchy for CPU 3
[    0.024601] GICv3: CPU3: found redistributor 3 region 0:0x000000000c0e0000
[    0.024612] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[    0.024647] smp: Brought up 1 node, 4 CPUs
[    0.024696] SMP: Total of 4 processors activated.
[    0.024703] CPU features: detected: 32-bit EL0 Support
[    0.024709] CPU features: detected: CRC32 instructions
[    0.024750] CPU features: emulated: Privileged Access Never (PAN) using TTBR0_EL1 switching
[    0.024760] CPU: All CPU(s) started at EL2
[    0.024765] alternatives: applying system-wide alternatives
[    0.026549] devtmpfs: initialized
[    0.028663] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.028695] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.028808] pinctrl core: initialized pinctrl subsystem
[    0.029108] DMI not present or invalid.
[    0.029518] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.029805] DMA: preallocated 256 KiB GFP_KERNEL pool for atomic allocations
[    0.029840] DMA: preallocated 256 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[    0.029875] DMA: preallocated 256 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    0.030283] thermal_sys: Registered thermal governor 'fair_share'
[    0.030286] thermal_sys: Registered thermal governor 'bang_bang'
[    0.030293] thermal_sys: Registered thermal governor 'step_wise'
[    0.030299] thermal_sys: Registered thermal governor 'user_space'
[    0.030383] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    0.030446] ASID allocator initialised with 65536 entries
[    0.042250] cryptd: max_cpu_qlen set to 1000
[    0.043323] iommu: Default domain type: Translated
[    0.043348] iommu: DMA domain TLB invalidation policy: strict mode
[    0.043479] SCSI subsystem initialized
[    0.043599] libata version 3.00 loaded.
[    0.043698] usbcore: registered new interface driver usbfs
[    0.043723] usbcore: registered new interface driver hub
[    0.043746] usbcore: registered new device driver usb
[    0.043981] i2c-gpio i2c-gpio-0: using lines 427 (SDA) and 428 (SCL)
[    0.044100] i2c-gpio i2c-gpio-1: using lines 429 (SDA) and 430 (SCL)
[    0.044146] pps_core: LinuxPPS API ver. 1 registered
[    0.044153] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <[email protected]>
[    0.044167] PTP clock support registered
[    0.045063] vgaarb: loaded
[    0.065282] clocksource: Switched to clocksource arch_sys_counter
[    0.069390] NET: Registered PF_INET protocol family
[    0.069592] IP idents hash table entries: 32768 (order: 6, 262144 bytes, linear)
[    0.070659] tcp_listen_portaddr_hash hash table entries: 1024 (order: 2, 16384 bytes, linear)
[    0.070710] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.070725] TCP established hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.070800] TCP bind hash table entries: 16384 (order: 7, 524288 bytes, linear)
[    0.071204] TCP: Hash tables configured (established 16384 bind 16384)
[    0.071329] UDP hash table entries: 1024 (order: 3, 32768 bytes, linear)
[    0.071376] UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes, linear)
[    0.071534] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.072247] PCI: CLS 0 bytes, default 64
[    0.072425] Unpacking initramfs...
[    0.084327] Initialise system trusted keyrings
[    0.084465] workingset: timestamp_bits=46 max_order=19 bucket_order=0
[    0.087613] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.087701] jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
[    0.110634] Key type asymmetric registered
[    0.110670] Asymmetric key parser 'x509' registered
[    0.110761] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 248)
[    0.110772] io scheduler mq-deadline registered
[    0.110779] io scheduler kyber registered
[    0.143070] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
[    0.164752] 11002000.serial: ttyS0 at MMIO 0x11002000 (irq = 116, base_baud = 2500000) is a ST16650V2
[    0.993604] printk: console [ttyS0] enabled
[    1.019009] 11003000.serial: ttyS1 at MMIO 0x11003000 (irq = 117, base_baud = 1625000) is a ST16650V2
[    1.049535] 11004000.serial: ttyS2 at MMIO 0x11004000 (irq = 118, base_baud = 1625000) is a ST16650V2
[    1.059801] mtk_rng 1020f000.rng: registered RNG driver
[    1.065537] cacheinfo: Unable to detect cache hierarchy for CPU 0
[    1.075342] loop: module loaded
[    1.080366] spi-nand spi0.0: Winbond SPI NAND was found.
[    1.085721] spi-nand spi0.0: 128 MiB, block size: 128 KiB, page size: 2048, OOB size: 64
[    2.610714] Initramfs unpacking failed: invalid magic at start of compressed archive
[    2.814828] Freeing initrd memory: 563200K
[    2.831788] 4 fixed-partitions partitions found on MTD device spi0.0
[    2.838195] Creating 4 MTD partitions on "spi0.0":
[    2.842984] 0x000000580000-0x000008000000 : "ubi"
[    2.984497] 0x000000380000-0x000000580000 : "fip"
[    2.991967] 0x000000080000-0x000000380000 : "reserved"
[    3.001262] 0x000000000000-0x000000080000 : "bl2"
[    3.008516] sfp sfp-1: Host maximum power 3.0W
[    3.013502] sfp sfp-2: Host maximum power 3.0W
[    3.032080] mtk_soc_eth 15100000.ethernet: generated random MAC address 2e:b9:81:a0:0c:51
[    3.040607] mtk_soc_eth 15100000.ethernet eth0: mediatek frame engine at 0xffffffc00b380000, irq 121
[    3.050005] mtk_soc_eth 15100000.ethernet eth1: mediatek frame engine at 0xffffffc00b380000, irq 121
[    3.059562] usbcore: registered new interface driver usb-storage
[    3.065795] i2c_dev: i2c /dev entries driver
[    3.072178] mtk-wdt 1001c000.watchdog: Watchdog enabled (timeout=31 sec, nowayout=0)
[    3.080909] SMCCC: SOC_ID: ID = jep106:0426:7986 Revision = 0x00000000
[    3.087598] usbcore: registered new interface driver usbhid
[    3.093172] usbhid: USB HID core driver
[    3.097994] ipt_CLUSTERIP: ClusterIP Version 0.8 loaded successfully
[    3.104564] NET: Registered PF_INET6 protocol family
[    3.126667] Segment Routing with IPv6
[    3.130342] RPL Segment Routing with IPv6
[    3.134374] In-situ OAM (IOAM) with IPv6
[    3.138419] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    3.144047] mmc0: host does not support reading read-only switch, assuming write-enable
[    3.144720] NET: Registered PF_PACKET protocol family
[    3.156174] mmc0: new high speed SDHC card at address aaaa
[    3.157433] Bridge firewalling registered
[    3.163722] mmcblk0: mmc0:aaaa SA16G 14.8 GiB
[    3.167037] 8021q: 802.1Q VLAN Support v1.8
[    3.175521] Key type dns_resolver registered
[    3.177532] GPT:Primary header thinks Alt. header is not at the end of the disk.
[    3.180088] Loading compiled-in X.509 certificates
[    3.187165] GPT:1 != 31116287
[    3.187168] GPT:Alternate GPT header not at the end of the disk.
[    3.200683] mtk-pcie-gen3 11280000.pcie: host bridge /soc/pcie@11280000 ranges:
[    3.200959] GPT:1 != 31116287
[    3.208268] mtk-pcie-gen3 11280000.pcie: Parsing ranges property...
[    3.211134] GPT: Use GNU Parted to correct GPT errors.
[    3.217391] mtk-pcie-gen3 11280000.pcie:      MEM 0x0020000000..0x002fffffff -> 0x0020000000
[    3.222528]  mmcblk0: p1 p2 p3 p4 p5 p6 p7
[    3.345099] sfp sfp-1: module RAD Data Comm.   SFP-30H          rev 1.0  sn OP18060400248    dc 180604
[    3.445282] mtk-pcie-gen3 11280000.pcie: PCIe link down, current LTSSM state: detect.active (0x1000001)
[    3.454685] mtk-pcie-gen3: probe of 11280000.pcie failed with error -110
[    3.479661] mt7530 mdio-bus:1f: no interrupt support
[    3.513846] mt7530 mdio-bus:1f: configuring for fixed/2500base-x link mode
[    3.521017] mt7530 mdio-bus:1f: Link is Up - 2.5Gbps/Full - flow control rx/tx
[    3.530216] mt7530 mdio-bus:1f wan (uninitialized): PHY [mt7530-0:00] driver [MediaTek MT7531 PHY] (irq=POLL)
[    3.550358] mt7530 mdio-bus:1f lan0 (uninitialized): PHY [mt7530-0:01] driver [MediaTek MT7531 PHY] (irq=POLL)
[    3.570300] mt7530 mdio-bus:1f lan1 (uninitialized): PHY [mt7530-0:02] driver [MediaTek MT7531 PHY] (irq=POLL)
[    3.590220] mt7530 mdio-bus:1f lan2 (uninitialized): PHY [mt7530-0:03] driver [MediaTek MT7531 PHY] (irq=POLL)
[    3.610159] mt7530 mdio-bus:1f lan3 (uninitialized): PHY [mt7530-0:04] driver [MediaTek MT7531 PHY] (irq=POLL)
[    3.621104] device eth0 entered promiscuous mode
[    3.625779] DSA: tree 0 setup
[    3.630171] xhci-mtk 11200000.usb: xHCI Host Controller
[    3.635426] xhci-mtk 11200000.usb: new USB bus registered, assigned bus number 1
[    3.645814] xhci-mtk 11200000.usb: hcc params 0x01403f99 hci version 0x110 quirks 0x0000000000210010
[    3.654971] xhci-mtk 11200000.usb: irq 127, io mem 0x11200000
[    3.660808] xhci-mtk 11200000.usb: xHCI Host Controller
[    3.666029] xhci-mtk 11200000.usb: new USB bus registered, assigned bus number 2
[    3.673414] xhci-mtk 11200000.usb: Host supports USB 3.2 Enhanced SuperSpeed
[    3.680936] hub 1-0:1.0: USB hub found
[    3.684704] hub 1-0:1.0: 2 ports detected
[    3.689090] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[    3.697571] hub 2-0:1.0: USB hub found
[    3.701346] hub 2-0:1.0: 1 port detected
[    3.706428] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    3.722415] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    3.732576] Freeing unused kernel memory: 4032K
[    3.815323] Run /init as init process
[    3.818987]   with arguments:
[    3.821944]     /init
[    3.824205]   with environment:
[    3.827341]     HOME=/
[    3.829689]     TERM=linux
[    3.832383]     board=DiagBox
[    3.927976] FAT-fs (mmcblk0p5): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[    3.951531] EXT4-fs (mmcblk0p6): mounted filesystem with ordered data mode. Quota mode: disabled.
[    3.973324] EXT4-fs (mmcblk0p7): mounted filesystem with ordered data mode. Quota mode: disabled.
[    4.050760] udevd[1108]: starting version 3.2.9
[    4.165280] usb 1-1: new high-speed USB device number 2 using xhci-mtk
[    4.345989] hub 1-1:1.0: USB hub found
[    4.349807] hub 1-1:1.0: 4 ports detected
[    4.765275] usb 1-1.1: new high-speed USB device number 3 using xhci-mtk
[   11.365550] random: crng init done
[   11.377402] udevd[1123]: starting eudev-3.2.9
[   11.407299] usbcore: registered new interface driver usbserial_generic
[   11.415954] usbserial: USB Serial support registered for generic
[   11.436352] usbcore: registered new interface driver cdc_wdm
[   11.444296] usbcore: registered new interface driver option
[   11.450118] qmi_wwan 1-1.1:1.4: cdc-wdm0: USB WDM device
[   11.451169] usbserial: USB Serial support registered for GSM modem (1-port)
[   11.457717] qmi_wwan 1-1.1:1.4 wwan0: register 'qmi_wwan' at usb-11200000.usb-1.1, WWAN/QMI device, 86:7e:39:1b:f3:d3
[   11.473759] usbcore: registered new interface driver qmi_wwan
[   11.474085] option 1-1.1:1.0: GSM modem (1-port) converter detected
[   11.496687] usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB0
[   11.503841] option 1-1.1:1.1: GSM modem (1-port) converter detected
[   11.510615] usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB1
[   11.517850] option 1-1.1:1.2: GSM modem (1-port) converter detected
[   11.525756] usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB2
[   11.532955] option 1-1.1:1.3: GSM modem (1-port) converter detected
[   11.539786] usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB3
[   11.572702] mtdblock: MTD device 'ubi' is NAND, please consider using UBI block devices instead.
[   11.574089] mtdblock: MTD device 'fip' is NAND, please consider using UBI block devices instead.
[   11.574322] mtdblock: MTD device 'bl2' is NAND, please consider using UBI block devices instead.
[   11.581841] mtdblock: MTD device 'reserved' is NAND, please consider using UBI block devices instead.
[   12.301364] br0: port 1(lan0) entered blocking state
[   12.306362] br0: port 1(lan0) entered disabled state
[   12.327767] device lan0 entered promiscuous mode
[   12.334676] br0: port 2(lan1) entered blocking state
[   12.339643] br0: port 2(lan1) entered disabled state
[   12.356364] device lan1 entered promiscuous mode
[   12.362437] br0: port 3(lan2) entered blocking state
[   12.367414] br0: port 3(lan2) entered disabled state
[   12.386360] device lan2 entered promiscuous mode
[   12.392434] br0: port 4(lan3) entered blocking state
[   12.397397] br0: port 4(lan3) entered disabled state
[   12.416364] device lan3 entered promiscuous mode
[   12.422419] br0: port 5(lan4) entered blocking state
[   12.427384] br0: port 5(lan4) entered disabled state
[   12.446360] device lan4 entered promiscuous mode
[   12.712993] mtk_soc_eth 15100000.ethernet eth0: configuring for fixed/2500base-x link mode
[   12.721381] mtk_soc_eth 15100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
[   12.735589] mt7530 mdio-bus:1f lan0: configuring for phy/gmii link mode
[   12.892305] mt7530 mdio-bus:1f lan1: configuring for phy/gmii link mode
[   13.062333] mt7530 mdio-bus:1f lan2: configuring for phy/gmii link mode
[   13.232321] mt7530 mdio-bus:1f lan3: configuring for phy/gmii link mode
[   13.402255] mt7530 mdio-bus:1f lan4: configuring for inband/2500base-x link mode
[   14.875526] mt7986-wmac 18000000.wifi: HW/SW Version: 0x8a108a10, Build Time: 20220113162701a
[   14.875526]
[   14.902051] mt7986-wmac 18000000.wifi: WM Firmware Version: ____000000, Build Time: 20220113162756
[   14.951884] mt7986-wmac 18000000.wifi: WA Firmware Version: DEV_000000, Build Time: 20220113163034
[   19.226462] br0: port 6(wlan0) entered blocking state
[   19.231531] br0: port 6(wlan0) entered disabled state
[   19.236747] device wlan0 entered promiscuous mode
[   19.241517] br0: port 6(wlan0) entered blocking state
[   19.246568] br0: port 6(wlan0) entered forwarding state
[   19.265347] br0: port 6(wlan0) entered disabled state
[   19.539440] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   19.545936] br0: port 6(wlan0) entered blocking state
[   19.550980] br0: port 6(wlan0) entered forwarding state
[   19.960978] IPv6: ADDRCONF(NETDEV_CHANGE): br0: link becomes ready
[   19.967482] br0: port 7(wlan1) entered blocking state
[   19.972538] br0: port 7(wlan1) entered disabled state
[   19.977747] device wlan1 entered promiscuous mode
[   19.982542] br0: port 7(wlan1) entered blocking state
[   19.987593] br0: port 7(wlan1) entered forwarding state
[   20.046828] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready

Here the bootlog :slight_smile:

I noticed that the Error comes when i wake up the eth1 :

# ifup eth1
[  136.346304] mtk_soc_eth 15100000.ethernet eth1: configuring for inband/2500base-x link mode
udhcpc: started, v1.32.0
[  136.412346] mtk_soc_eth 15100000.ethernet eth1: validation with support 00000000,00000000,00000000 failed: -EINVAL
[  136.422804] sfp sfp-1: sfp_add_phy failed: -EINVAL

does not look like i2c issue as sfp is correctly recognized

i guess it is a bug in the phylink-patch(es)…you could try reverting russels commit and reenable lyxis version

reverting

1c5c3d72db22 2022-10-24 phylink: update mtk sgmii

and

227ce52fc799 2022-10-24 Revert "net: mtk_sgmii: implement mtk_pcs_ops"

I will use git to get your kernel and allow me to revert.

Until now, i download your kernel source with my browser.

Before i tested with kernel 6.1-r3, 6.0-r3 and 5.19-r3. Same results.

Mhm,6.0 does not contain russels patch…so this is not the cause. 5.19 had afair no sfp support

Hy

News about my problem ^^

About the SFP rj45, the mine doesn’t work with Bananapi r3.

It doesn’t matter, i will take another.

it’s the only one sfp which has an error message. I tested with sfp gpon onu, and 4 sfp lc. They return no error message.

For my sfp gpon onu. In the sfp wan, the network doesn’t work. Even if it is recognized ( see with ethtool and ethtool -m)

But when i used it on the sfp lan(sfp cage close to rj45),it works if :

i create a bridge and put the sfp into. so i just put the sfp into. But the big problem is the debit.

I have a connexion of 2gpbs down and 800mb up. My sfp is a 2gbps, tested in antoher sbc.

I done a speedtest and i have :

 Server: ORANGE FRANCE - Marseille (id = 29545)
    ISP: Orange
Latency:     4.43 ms   (0.11 ms jitter)
   Download:    63.72 Mbps (data used: 122.5 MB)
 Upload:     0.66 Mbps (data used: 880.4 kB)
Packet Loss:     3.3%

Here my interfaces config :

iface eth0 inet static
        address 192.168.1.1
        netmask 255.255.255.0

iface br0 inet static
  address 192.168.1.2
  netmask 255.255.255.0

iface lan4 inet manual
  post-up /sbin/ip l s up dev $IFACE


iface orange inet manual
  #Creer le vlan 832 et les priorités
  pre-up /sbin/ip l a link lan4 name $IFACE type vlan id 832 egress-qos-map 0:6

If i don’t give an address to eth0, nothing work.

I tried to create a bridge wan with sfp wan and eth wan. But same result. Have you 2 bridges : 1 for lan and 1 for wan?

My trees had some wrong gpio definitions (properties need to be plural - so “gpios” and mod-def0 needs additional dash) have already fixed on 6.1 tree. My sfp worked with these wrong properties (so i had not noticed it),but maybe other sfp do not.

I currently have no bridge…woeking directly on interfaces,but can only test 1g (iperf3.to my laptop or my main router which looked good for both sfp and rj45 ports before and after russels patch).

I think i have found the problem, not sur ^^

In my last SBC, i use iptables for qos

# Generated by iptables-save v1.4.21 on Wed Feb 20 23:25:13 2019
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A POSTROUTING -o orange -j MASQUERADE
COMMIT
# Completed on Wed Feb 20 23:25:13 2019
# Generated by iptables-save v1.4.21 on Wed Feb 20 23:25:13 2019
*mangle
:PREROUTING ACCEPT [604:477856]
:INPUT ACCEPT [589:476608]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [487:83466]
:POSTROUTING ACCEPT [487:83466]
-A POSTROUTING -o orange -j CLASSIFY --set-class 0000:0001
-A POSTROUTING -o orange -p igmp -j CLASSIFY --set-class 0000:0006
-A POSTROUTING -o orange -p icmp -j CLASSIFY --set-class 0000:0006
-A POSTROUTING -o orange -m dscp --dscp 0x2e -j CLASSIFY --set-class 0000:0005
-A POSTROUTING -o orange -p udp --dport 67 -j CLASSIFY --set-class 0000:0006

But when i apply this rules i have an error :

iptables v1.8.5 (legacy): unknown option "--set-class"
Try `iptables -h' or 'iptables --help' for more information.

Found :slight_smile:

I have forgotten some options in my Kernel for the netfilter part.

with the good iptables rules :

   Speedtest by Ookla

     Server: ORANGE FRANCE - Marseille (id = 29545)
        ISP: Orange
    Latency:     3.92 ms   (0.15 ms jitter)
   Download:  2202.73 Mbps (data used: 1.1 GB)
     Upload:   808.81 Mbps (data used: 394.7 MB)
Packet Loss:     0.0%
 Result URL: https://www.speedtest.net/result/c/3a29041b-5fb1-4e64-a6aa-8959e12a1cdd
#

stay only one little problem :
the sfp wan cage, why the network doesn’t pass.

If above config is still active you have still ip set on eth0…

Wan-sfp is eth1 and needs different ip subnet than your lan-bridge

I’ve seen this error with FINISAR 1000Base-T SFP module. Turns out it needs Marvell PHY driver to function, which I have now packaged in OpenWrt:

Try enabling kmod-phy-marvell in your build. If that still doesn’t help, please install mdio-tools and show the output of mdio *sfp2 (assuming the SFP is inserted to sfp2 cage).

If you are using vanilla Linux (e.g. build e.g. from Frank’s tree) make sure you enable CONFIG_MARVELL_PHY in your build.

1 Like

Hy, that the solution for my sfp rj45. Thank you a lot

Hy :slight_smile:

So i tried like you, no bridge for wan.

Set configuration into interfaces files Example for interface wan in dhcp mode :slight_smile:

iface wan inet dhcp

Results:

For ethernet wan : OK

For sfp lan (next to rj45) : OK tested with sfp rj45 (dhcp) and sfp gpon onu

For sfp wan:

# ifup eth1
[  141.296441] mtk_soc_eth 15100000.ethernet eth1: configuring for inband/2500base-x link mode
udhcpc: started, v1.32.0
[  141.365490] mtk_soc_eth 15100000.ethernet eth1: switched to inband/sgmii link mode
udhcpc: sending discover
[  141.542412] mtk_soc_eth 15100000.ethernet eth1: PHY [i2c:sfp-1:16] driver [Marvell 88E1111] (irq=POLL)
udhcpc: sending discover
udhcpc: sending discover
udhcpc: no lease, failing
# ifup eth1
udhcpc: started, v1.32.0
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: no lease, failing

# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1504 qdisc fq_codel state UP group default qlen 1000
    link/ether 8a:36:4f:f9:8c:b0 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.1/24 scope global eth0
       valid_lft forever preferred_lft forever
3: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
    link/ether 00:0a:35:00:00:01 brd ff:ff:ff:ff:ff:ff
4: tunl0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
    link/ipip 0.0.0.0 brd 0.0.0.0
5: wan@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN group default qlen 1000
    link/ether 00:0a:35:00:00:01 brd ff:ff:ff:ff:ff:ff

Interface ifles :

iface eth1 inet dhcp