# TTL and ONT



## freejlr (Mar 18, 2022)

Hi guys, I need to access my ONT but my ISP didn't give me the username and password to access as root.

I have seen users connecting to the ONT through the uart, in order to capture the boot data.

Well, I don't know anything about electronics, and I thought it would be simpler, but my ONT board on the pins doesn't have a reflection of what it is.

If it is RX, TX GND etc... How could I identify each pin? On the other hand in my USB I have 5 pins RX,TX,GND,5V,3V3.

The voltage pins are to power devices that do not have current? In this case, if I feed my ONT with its supply, I would not need to connect those pins? Only RX, TX and GND?

Sorry if I'm saying something incoherent

On the other hand, my ONT board has three other pins, which I don't even know what they are. I will make the connection with Putty, I have seen that FreeBSD detects my USB as uslcom, when I get the communication with Putty, I will try it with Freebsd and uart.

I leave some screenshots.

https://ibb.co/g4KqVxc
https://ibb.co/7jp9bHj
https://ibb.co/P900w2P
https://ibb.co/Bw7jPvc

Regards.


----------



## msplsh (Mar 19, 2022)

You're right.  Don't connect the 5+ or 3+ pins to anything.

You probably will not break anything randomly trying out which pins are which.  However, if the header is not actually a TTL UART, that's a danger of breaking something.


----------



## oOiOo (Mar 19, 2022)

freejlr said:


> Hi guys, I need to access my ONT but my ISP didn't give me the username and password to access as root.
> 
> I have seen users connecting to the ONT through the uart, in order to capture the boot data.


Seems to be frequent in Spain


----------



## ralphbsz (Mar 19, 2022)

OK, you have an ONT ... which is nothing but a simple networking device, which connects your ISPs optical network to your copper network. That ONT has an internal connector with 5 pins. You have no idea what those pins are. You can probably identify one pin that is ground by looking at the copper traces: it's the pin connected to the big areas of copper. You might be able to identify a +5V or +12V pin using a volt meter, by checking whether it is connected to the power pin of any chip or the input pin. But to build a serial interface, you need 3 pins (Gnd, RX, TX), and you have 5 pins, so this will require a lot of trial and error.

Next question: You think that 5-pin connection on the ONT is a UART. There are lots of different types of UART, depending on the voltage. It might 3.3V, 5V, or +- 12V. Since we don't know what these pins are connected to, we have no idea. If you connect your USB-based serial board and the UART on the ONT at the wrong voltage, they will probably not work, and perhaps blow up (although probable not, most inputs today can handle 12V safely). One important hint would be to try to trace the copper lines from the 5 pins. If any go into a chip that says something like "MAX232" (or any chip that has 232 in its model number), then you know what their function is. There is a small surface-mount 8-pin chip nearby, you might want to check it.

Failing that, all you can do is use a voltmeter and check voltages, and do trial and error.

Now lets assume you get the hardware interface to work. How will you know that you have succeeded? Do you even know the protocol to use on the serial interface? What characters will you send, what responses do you expect back?


----------



## freejlr (Mar 19, 2022)

With a voltmeter I have identified GND there is a pin that does not beep and has voltage, no continuity, then the other three have 3.3V.

I have managed to report information but nothing clear, as expected.

My intention was to try to capture some data, about my username and password, I can't access my ONT.

I only get data like this, I don't know if I'm doing something wrong, or if it's as it should be.






If this way is not possible, I will have to find another way to know that information.

Regards.


----------



## ralphbsz (Mar 20, 2022)

freejlr said:


> With a voltmeter I have identified GND


Good starting point



> there is a pin that does not beep and has voltage, no continuity,


What does "not beep" or "no continuity" mean? My suspicion: Given that its voltage is near 0, it is probably an input, so it might be the receive data pin (assuming serial).



> then the other three have 3.3V.


Quite possible that one of those is transmit data. If I remember right, an idle serial port is high, which in 3.3V TTL logical is about 3.3V. 



> I only get data like this, I don't know if I'm doing something wrong,


Have you checked baud rate? Today, any number of bits other than 8 is unlikely, and parity is rarely used.


----------



## freejlr (Mar 20, 2022)

ralphbsz said:


> Good starting point
> 
> 
> What does "not beep" or "no continuity" mean? My suspicion: Given that its voltage is near 0, it is probably an input, so it might be the receive data pin (assuming serial).
> ...



Correct, my baud rate was wrong, now I can see the boot sequence.

But I am unable to communicate with TX, if I thought that pin with voltage 0 would be the input, but I have tried all the pins other than GND and RX.

In the usb the led remains inactive all the time, I am unable to transmit anything, since when starting the boot, it tells you to press any key to interrupt it.

The boot, you can see the login for a second, but then it disappears and you can't see anything at all.

I think that the next step would be to be able to interact with the ONT system to be able to see the users, etc... what do you think?

I leave a link to pastebin, where you can see the whole sequence, if you could see my ISP and my zone code 

Boot

On line 195 the login begins, but as I said it is hidden instantly. On the other hand there are three more pins that I don't know what they do, one of them is GND the other two have 3.3V.

Regards.

P.S: in line 190, it can be seen as some variables, which can be the user and the pass.


----------



## ralphbsz (Mar 21, 2022)

Your "USB thing" is a little USB-to-serial adapter, if you look carefully at the picture, you see a Silicon Labs CP2102, which is a common USB serial adapter. I don't know how it is wired, but you may have to configure your FreeBSD serial port to not use hardware flow control, that might enable the transmit line.

Another good idea: You can buy USB-to-serial adaptors that have LEDs for the RxD and TxD lines. I think Adafruit has those in the US (if I remember right, there is one in my basement box of random adaptors). Those are exceedingly useful, to see whether there is any traffic.


----------



## freejlr (Mar 22, 2022)

I'll try, but I forgot to say the reason for all this, and maybe it's not necessary. If it is better I will put it in another new thread, my idea is to install an sfp card and the module, to be able to get rid of all the equipment of my ISP.

I have seen that it can be done, but I don't know what I need apart from that, I doubt very much that be as simple as having the ISP team put the router in bridge mode and PPPoe. I have seen that freebsd supports several cards, but I guess I will need data from my ONT.


IYes my usb to ttl adapter has rx and tx leds, I'll try it.

Regards.


----------



## SirDice (Mar 22, 2022)

freejlr said:


> https://ibb.co/7jp9bHj


That 5 pin connector could be a JTAG port. You typically use that to program and/or debug an FPGA/CPLD. The traces on the PCB from the connector appear to go directly to that flatpack chip in the middle. Can you identify that chip? I can't read the markings on the picture. If you can identify the chip you might be able to lookup the datasheet for it. Armed with that information you should be able to tell what that connector is actually connected to.


----------



## covacat (Mar 22, 2022)

i doubt you can replace the gpon box with an ethernet card


----------



## freejlr (Mar 22, 2022)

SirDice said:


> That 5 pin connector could be a JTAG port. You typically use that to program and/or debug an FPGA/CPLD. The traces on the PCB from the connector appear to go directly to that flatpack chip in the middle. Can you identify that chip? I can't read the markings on the picture. If you can identify the chip you might be able to lookup the datasheet for it. Armed with that information you should be able to tell what that connector is actually connected to.


I'll try.



covacat said:


> i doubt you can replace the gpon box with an ethernet card


It is not an ethernet card, if an sfp card, plus an sfp module, the cards would be easy, just look for one that is supported by freebsd.

But see what sfp modules are compatible with the card and my ISP doesn't know that anymore. Of there you want to have as much data as possible.

Regards.


----------



## freejlr (Mar 22, 2022)

For example, I think this user is using his chelsio locally, my intention is to make a PPPoe connection, as if it were with my computer in bridge mode. 

But having the direct fiber to the sfp card. I guess it's possible.

https://forums.freebsd.org/threads/network-card-sfp-module-status.68666/


----------



## covacat (Mar 22, 2022)

actually it might work with something like this
https://www.aliexpress.com/item/4000086970977.html and 
https://www.amazon.com/TP-Link-Ethernet-Converter-Supporting-MC220L/dp/B003CFATL0 (so you don't need a 'sfp card')
you still might need isp assistance
the sfp is actually a mini ONT


----------



## ipsum (Mar 23, 2022)

ONT, as defined in the GPON standard, is not a simple media converter. ONT shares last mile passive fiber connection from OLT with many other (up-to 32, 64 or 128) ONTs in the neighbourhood. So it must use particular protocol, to communicate properly with OLT, and not to disturb these other ONTs. None of the above two examples would work.





						GPON - Wikipedia
					






					en.wikipedia.org


----------



## covacat (Mar 23, 2022)

ipsum said:


> None of the above two examples would work.


"
• Complies with ITUT-T G.984.2, G.984.2 Amendment 1
• Complies with ITUT G.988 ONU management and control interface (OMCI) specification
"
people actually used the 'gpon stick' in russia on rostelecom network
read the comments on the aliexpress page
the sfp/stick is actually a mini/embedded ont


----------



## ipsum (Mar 24, 2022)

OK, my bad failing to scroll down the page and check technical details. Yes the stick is an ONT device and rostelecom seems to be the one that tolerates (or even approved) the device for their FTTH service. All the comments on the aliexpress page, except just a few ones, seem to come from russia only. But still, I don't think any ISP would let plug their fiber to just any ITU-standard ONT. Mainly for stability and (more importantly?) business reasons.

Coming back to the OP and his reasons. In your first post here you said about "the username and password to access as root" (which then appeared to be an attempt to login to the shell of the ONT box itself), while later you clarified that you actually needed PPPoE authentication details. So, did you ask a proper question to your customer service and they understood you? It may be also possible that you can setup a new password yourself, using your account page at your ISP (this is the way it works with my ISP). In such a case the helpdesk would definitely not have access to your password, but should give you advice how you recover/change it yourself. Also, if your helpdesk is not helpful about that, try your local community support forum, if there is any.


----------



## freejlr (Mar 27, 2022)

I have already identified all the pins, and I have been able to interact with the ONT. But I have not got anything about the user and the pass.

By letting the boot sequence finish, I try to interact with the console, it asks me again for the login and the pass. 





So it's useless... The session is not logged. You can only see some information before boot, and some variables.





What would be the step to follow, since the session is not permanently logged?Copy some image as the root one, there you can see it in the global variables, but how?

My intention is to know all the possible data, I do not want to make a PPPoe connection, with that it would only be enough to put my router in bridge mode and my PPPoe user and pass. But my intention is to remove all the equipment from my ISP, I think I will need more information.

I'm going to see the equipment that I provide covacat. 

Regards.


----------



## covacat (Mar 27, 2022)

try to boot it in single user mode
also you can log from putty or whatever terminal you use


----------



## msplsh (Mar 28, 2022)

What would I do?  Use those commands to dump the entire contents of the "memory", fpga, and SPI flash and see what's in there.  If it's Linux, maybe they have a filesystem with a script on there that does the login and reads the username and password from a file.


----------



## Phishfry (Mar 29, 2022)

Agreed. Dig into your u-boot menu.
Chances  are they have stripped out useful tidbits.
But look at emmc and partitions on it to get clues to the base OS.
Perhaps figure out CPU used and make your own u-boot build with everything enabled.
That might be a tall order as I am sure there is no public uboot build for this device.
So fake it until you make it. Is there an USB port on the device?


----------



## Phishfry (Mar 29, 2022)

freejlr said:


> You can only see some information before boot, and some variables.


Yes that is all you need to get started. That is the u-boot console.
You got further than I imagined possible.
Using u-boot makes this feasible. I dunno about finding your credentials though.
That seems sketchy.
But congratulations on finding a u-boot console. That was the hard part.
Now back it up and hack it up.


----------



## freejlr (Mar 31, 2022)

The ONT never logs in with the user, the kernel simply shows the events in the first tty and overwrites the login. No, the ONT does not have a USB port, in any case if I have to copy something, I don't know if I can do it directly from the COM port to my machine.

I have seen that my ISP has a U-BOOT manual, but as mentioned, my U-BOOT seems incomplete and with hidden functions, or it is another version...

U-Boot reference

I want to thank you for your support, this weekend I will have time to look in more detail at the options you have told me.


----------



## covacat (Mar 31, 2022)

modify the bootcmd env and add init=/bin/bash or /bin/sh


----------



## msplsh (Mar 31, 2022)

freejlr said:


> No, the ONT does not have a USB port, in any case if I have to copy something, I don't know if I can do it directly from the COM port to my machine.


If there's a JTAG interface, you may be able to get it that way.


----------



## Phishfry (Mar 31, 2022)

I think the best bet at this point is to at least make a backup of your u-boot environment.
Even if that means using a terminal and cut and paste to a local file.
At least give yourself somewhere to look back at.

`printenv` is what you want to backup before modifications.


----------



## freejlr (Apr 12, 2022)

So I've been checking other things, and I've realized that even if I had all the information I need I would still have more problems.


My ont connects to the GPON network, the OLT asks for a serial number and assigns an ONU-ID. Then a PLOAM or idont will appear, which in the case of my ISP is the identifier of the ONT that is assigned to each client in the registration process.
service.

On the other hand, I have to write in my sfp module, so that I can put the idont key, the serial number.

Apart from that I have to modify the manufacturer codes, hardware version and again the serial number, so that the OLT creates
that my SFP module is the ONT provided by the ISP.

I think I've seen some modules on fs.com that can be useful. I will try again to get my ISP to provide me with the user data.... If not, I will have no other option than to try to access, or otherwise change ISP.

Regards.


----------



## VladiBG (Apr 12, 2022)

You can dump the JFFS2 from Uboot to tftp server then mount it to read the shadow file then you will need John the ripper with rainbow table to crack the password which can take several decades OR call your ISP Support and explain why you need access to the ISP equipment.


----------



## freejlr (Apr 15, 2022)

My ISP has given me refusals on 2 occasions, it is not possible to provide the ONT user and pass.

The only thing they can provide me with is my PPPoe user, and from what I've seen my ISP recently provides them, a while ago they didn't even want to give you that.

It has not been possible for me to copy the content of the ONT to my PC, it would be ideal to be able to copy the content of the JFFS2 partition. How well you told me.

This idea has occurred to me, in case I managed to mount the JFFS2 system and be able to edit it, could I do the following...?

For example, in my gettytab I have the automatic login that refers to a user.


```
P|Pc|Pc console:\
       :al=myuser:ht:np:sp#9600:
```

Where do I want to go with this, I don't know how it will work well in U-Boot, but if I could do the same with the ONT user or better with root, that is possible in FreeBSD, it would be possible with the Linux system of the ONT?

With that I could rewrite the firmware to the ONT and I would have an automatic root login and I could change the password of the ONT user.

What do you think of the idea? It's possible? Because I don't have hardware to brute force the shadow file, otherwise with powerful equipment it would be very difficult.

Regards.


----------



## covacat (Apr 15, 2022)

init may or may not use the ttys file but if you can alter the rootfs you can start sshd and add various accounts to passwd/shadow
did you try do boot in single user mode by altering bootcmd env ? (add init=/bin/bash) also see








						Access the filesystem as the root user
					

Embedded device, Linux version 2.6.26.5, U-Boot 2009.03 bootloader. ARM Linux Kernel Image on NAND flash, loading from NAND.  How to access the filesystem as the root user, and to reset the root pa...




					unix.stackexchange.com


----------



## ipsum (Apr 15, 2022)

Why are you so determined to replace/hack your ONT? Unless it is bundled with router in one box, it is just a network termination. Don't you rather want your own router? In that case PPPoE login is all you need.


----------



## msplsh (Apr 15, 2022)

I wouldn't worry too much about what you'll have to do with the filesystem until you actually dump it either with the JTAG or with the weird console you get.  The password could just be lying around in plain text.


----------



## freejlr (May 28, 2022)

I found an ISP where all the data I need like my Idont and other data is accessible without trying to break the ONT keys.

So there is no point in trying to access my clearly obfuscated ONT, it is not my goal in itself.

On the other hand I have found an SFP module that is 100% programmable:

*CPGOS03-0490 v2.0*

I just have to check a few things before I continue. When you have it ready I will comment on it, maybe someone will be interested.

Although in itself it seems a bit of a waste of time and money, since it is only a curiosity.

Regards.


----------



## freejlr (Jul 11, 2022)

I have already obtained my GPON to be able to make the association with my OLT. I have written again to the distributor of SFP modules and he told me the following:

"We have several clients that have similar setups and have used chelsio cards, it is very important to take into account that in the new versions of the linux 5.x kernel several fixes were included to support the use of SFP GPON ONU transceiver, which only support Single readings -Byte in EEPROM, (Used to read transceiver details and use DDM function)

Like any other operating system, it should support PPPoE interfaces (FreeBSD PPPoE man page: https://www.freebsd.org/cgi/man.cgi?query=pppoe), remember that you have to configure VLAN 6 (data) on the network interface of your card (on the SFP port to which you are going to connect the GPON ONU SFP.)"

I will use a chelsio supported by the drivers cxgbe(4), I understand that I should not have problems, does anyone know anything about it?

On the other hand, I share the pdf about the sfp module in case someone is curious.

Regards.


----------



## Phishfry (Jul 11, 2022)

freejlr said:


> I will use a chelsio supported by the drivers cxgbe(4), I understand that I should not have problems, does anyone know anything about it?


They use Terminator as CPU/ASIC moniker and number to designate series.
T3= Oldest. S320 are dirt cheap. Run hot. Need fan. Skip these.
T4=Good cheap 10G. Needs cooling. T420-CR $40 and up used.
T5=Nice and one generation behind flagship. T520-CR-$120 used
T6=Newest cards T62100 $$$$

You can buy a new Dell T540 four port for the same price as a used two port.








						Dell Chelsio T540-CR 10Gb SFP+ Quad Port Full Height Network Card PMXRW CN-00PMX  | eBay
					

Part Number : PMXRW. MPN : PMXRW 0PMXRW CN-00PMXRW. Model : Dell P61WM Chelsio T540-CR. External Interfaces : SFP+. Interface Card Type : Fibre channel card. Type : Network Card. Network Ports : Optical SC.



					www.ebay.com
				




I find this interesting:


freejlr said:


> remember that you have to configure VLAN 6 (data) on the network interface of your card (on the SFP port to which you are going to connect the GPON ONU SFP.)"


So the real clue here is not Chelsio, but it needs a vlan6.


----------



## freejlr (Jul 14, 2022)

Yes, this is a screenshot of my ISP's router.




The PPP connection is made in VLAN6 as you can see in the screenshot, I guess the priority doesn't matter now.

So I suppose that I will need to create a vlan to be able to make the PPP connection from there, the truth is that at this point I am somewhat lost.

I have seen that FreeBSD has support for VLANs with the driver vlan(4)

So the chelsio interface would be only for the configuration of the SFP module? Since according to the pdf this is manageable through HTTP, SSH etc...

When I put the ISP's router in bridge mode, it raises my PPPoE connection logically through my interface in my case em0 and raises the pppoe interface through it, but in this case it is different, I have an interface for the chelsio card (for manage the SFP module) but I can't get up from there the PPP session since I have to create a vlan and from there raise the ppp interface , so I'm a bit lost.

Thanks.


----------



## Phishfry (Jul 14, 2022)

freejlr said:


> but I can't get up from there the PPP session since I have to create a vlan and from there raise the ppp interface , so I'm a bit lost.


I am not greatly familiar with vlans. PPP only with Cellular.
But I do remember that PPP uses a tun interface. So configure a vlan6 on tun0?
That is my best guess.


----------



## Phishfry (Jul 14, 2022)

Stealing from this post:








						Solved - PPPoE on my FreeBSD Router
					

Hi guys, lately I entered the BSD world, so I thought I'd retrieve a small mini-itx board and make a router/fw/dns etc. etc.  to learn a little bit about networks, BSD and to detach myself, as far as possible, from proprietary solutions.  I successfully managed to pull up the routing part...




					forums.freebsd.org
				





cloned_interfaces="vlan6"
create_args_vlan6="vlan 6 vlandev tun0"
or maybe
create_args_vlan6="vlan 6 vlandev cxgbe0"

Plus change ppp.conf as per that post.


----------



## freejlr (Jul 18, 2022)

Modify my rc.conf with these lines:



> cloned_interfaces="vlan6"
> create_args_vlan6="vlan 6 vlandev bge0 vlanpcp 1"



I was able to modify the priority with the vlanpcp parameter, my next step will be to put my router in bridge mode.

To try to lift the PPP connection on my vlan6 interface. I will take the links you gave me as a reference, unfortunately today I have not time.

Output of my ifconfig:



> bge0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
> options=c019b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,VLAN_HWTSO,LINKSTATE>
> ether f0:1f:af:d7:cc:01
> media: Ethernet autoselect
> ...



If I am able to bring up the PPP connection, I should not have any problems with the SFP module.

I appreciate the recommendation for the chelsio cards, I will try to find a European seller, to avoid tariffs, this one looks good and it is in the Netherlands.

Dell Chelsio T520

Regards.


----------



## freejlr (Jul 24, 2022)

I have brought up the ppp interface but not as expected.

My settings:

*rc.conf*


> ifconfig_em0=up



*ppp.conf*


> default:
> set log Phase tun command
> set ifaddr 10.0.0.1/0 10.0.0.2/0
> 
> ...



*netroute*


> Routing tables
> 
> Internet:
> Destination            Gateway           Flags     Netif     Expire
> ...



*ifconfig out*


> em0: flags=8863<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
> options=481249b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,WOL_MAGIC,VLAN_HWFILTER,NOMAP>
> ether 28:d2:44:3c:b7:76
> media: Ethernet autoselect (1000baseT <full-duplex>)
> ...



To lift up the connection:



> ppp -ddial telefonica



Everything works fine, but ppp was created on the tun0 interface, not vlan6 as it is supposed to be. It shouldn't work this way, right? If my ISP requires that I use vlan6?

Attempt to mount interface over vlan6 unsuccessfully.

My settings for vlan6:

*ppp.conf*


> set device PPPoE:vlan6


*rc.conf*


> ifconfig_em0=up
> cloned_interfaces="vlan6"
> ifconfig_vlan6="vlan 6 vlanpcp 1 vlandev em0"



*ifconfig out*


> em0: flags=8863<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
> options=481249b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,WOL_MAGIC,VLAN_HWFILTER,NOMAP>
> ether 28:d2:44:3c:b7:76
> media: Ethernet autoselect (1000baseT <full-duplex>)
> ...


*ppp.log*


> Jul 24 00:18:48 xv0 newsyslog[687]: logfile first created
> Jul 24 00:20:31 xv0 ppp[928]: Phase: Using interface: tun0
> Jul 24 00:20:31 xv0 ppp[928]: Phase: deflink: Created in closed state
> Jul 24 00:20:31 xv0 ppp[928]: tun0: Command: default: set ifaddr 10.0.0.1/0 10.0.0.2/0
> ...



It is unable to use vlan6, I don't know what I may be doing wrong.

Also try it with OpenBSD:
*
hostname.if*


> up    #for em0





> vlan 6 vlandev em0 txprio 1 rxprio 1 up   #for vlan6





> inet 0.0.0.0 0xffffffff NONE \
> pppoedev em0 authproto pap \                                                  #  pppoedev vlan6 authproto pap \ ### for vlan6
> authname adslppp@telefonicanetpa authkey adslppp up          #for pppoe0
> dest 0.0.0.1
> !/sbin/route add default -ifp pppoe0 0.0.0.1



Well, on the em0 interface everything works fine, but on vlan6 it doesn't.

The kernel shows this error message:



> Jul 23 23:35:21 xm1 /bsd: pppoe0: wrong interface, not accepting host unique
> Jul 23 23:35:21 xm1 /bsd: pppoe: received PADO but could not find request for it



So I don't understand, it is not necessary to raise my connection over vlan6? if it already works on tun0 or in the case of OpenBSD on pppoe0.

Am I doing something wrong, so vlan6 doesn't work? I forget about it and when I have my chelsio card it will be to substitute em0 for cxgbe0.
It would have to work, since here it is doing it only with em0, since the sfp module would do the function that my ISP's router is doing now, and I would have to open the connection through cxgbe0.

Any idea why vlan6 is not working? Apparently it is not necessary to use it, I don't really understand it.

Regards.


----------



## ipsum (Jul 24, 2022)

freejlr said:


> Everything works fine, but ppp was created on the tun0 interface, not vlan6 as it is supposed to be. It shouldn't work this way, right? If my ISP requires that I use vlan6?


well, it rather works as expected and tun0 is your gateway interface. vlan6 is what is used for your ppp session establishment, and nothing else. And actually you used it per your ISP requirement. For regular internet you use tun0, which gets created upon successful ppp session start. 

However, you may need to add the following in your rc.conf:
ppp_nat="YES" 
ppp_profile="telefonica"


----------



## free-and-bsd (Jul 24, 2022)

Thank you for a very interesting topic )))


----------



## ThePowerOfFuet (Jul 24, 2022)

freejlr said:


> set authname adslppp@telefonicapa
> set authkey XXXXXXXXX


It looks like this is incorrect (and the password is the same for everyone, no need to censor it).

Try this in PPP.conf instead:

```
set authname adslppp@telefonicanetpa
set authkey adslppp
```

Suerte!


----------



## freejlr (Jul 24, 2022)

ipsum said:


> well, it rather works as expected and tun0 is your gateway interface. vlan6 is what is used for your ppp session establishment, and nothing else. And actually you used it per your ISP requirement. For regular internet you use tun0, which gets created upon successful ppp session start.
> 
> However, you may need to add the following in your rc.conf:
> ppp_nat="YES"
> ppp_profile="telefonica"


No change adding those directives in rc.conf,I show my log after adding them :

*ppp.log*


> Jul 25 22:23:30 xv0 newsyslog[688]: logfile first created
> Jul 25 22:23:48 xv0 ppp[928]: Phase: Using interface: tun0
> Jul 25 22:23:48 xv0 ppp[928]: Phase: deflink: Created in closed state
> Jul 25 22:23:48 xv0 ppp[928]: tun0: Command: default: set ifaddr 10.0.0.1/0 10.0.0.2/0
> ...



I will contact the provider of the sfp, and I will explain what happened.

But apparently vlan6 is not required by my ISP, since when configuring PPP on the em0 interface everything works correctly and the session is started successfully.

So my ISP brings up the connection on the router in vlan6 as it could be in tun0 or inverse.... It is not a requirement, since if it were I would not be able to start the session through tun0 in Freebsd or in pppoe0 in OpenBSD .

So you shouldn't have problems with the chelsio card and the sfp, because in reality the sfp module's function will be that of the ONT, as the ISP's router is doing in bridge mode, simply acting as the ONT.

I will communicate this to the supplier, and I will not delay more in buying what is necessary.

Thanks guys.


----------



## freejlr (Aug 3, 2022)

The provider sent me the following response:



> Regarding what you told us about configuring only the PPPoE connection without the VLAN ID, this is because even though you have configured your ISP's router in single-user mode (Bridge), the router is not really working in bridge mode. "Full transparent bridge", otherwise it continues to have the VLAN configured for the WAN (PON port) and performs an untag of the VLAN ID on the Ethernet interfaces of the LAN of said router.
> 
> When you work with an ONU like ours (Full transparent bridge), the data traffic that is tagged with a VLAN ID goes directly to your host (FreeBSD), and the VLAN IDs are not filtered or removed, so your router You must have this VLAN ID configured on the network interface so that it is able to understand the data being sent/received and establish the PPPoE connection on it.



I think that answers the question, I can't emulate the working of the sfp module by bridging the ISP's router.

I understand that there is this problem, the error when using vlan6 in FreeBSD.I will place the order when I have the devices I will be able to carry out the test.

Regards.


----------



## freejlr (Aug 24, 2022)

Good and bad news

The good news is that I have the chelsio tr520-cr card and the sfp module. The bad news is that I couldn't verify the correct operation because my server doesn't start when I connect the chelsio card.

When I plug it in, my dell r320 does a characterization and reboots.

On the front it seems to me a CPU0704 error, but in the end it disappeared, in the boot it recognizes the chelsio card as well as the SAS controller. But when starting the firmwares and completing them, the server freezes.

Upon removing the chelsio card, the server boots without any problems. Does anyone have experience in these cases, I don't know what it could be, it's the first time I've had this type of problem and I'm not familiar with it.

Thanks.

Edit: It is connected in the expander next to the idrac module, if someone can help me and needs more information. I'll try to find out what it is, it's quite frustrating.

Edit 2:

I think there is some kind of incompatibility with my r320 and the chelsio card. Tomorrow I will take my card to my  work place, I will try if the card is recognized in an other machine, I will assign an address to the module and I will try to access it with telnet.

I will try to find a solution for my r320....


----------



## freejlr (Aug 31, 2022)

The Chelsio adapter is not compatible with my Dell PowerEdge R320.

Great, now I'll have to find a compatible computer, I don't have a computer with a PCI-E X4 connector either.

I don't know if I use a x4 to x8 PCI-E converter.

But I don't get it, does anyone know what professional machines these Chelsio adapters are designed for? The ideal would be to install it on a rack server that acts as a router, not on a conventional PC.

Regards.


----------



## freejlr (Sep 15, 2022)

My R320 is not compatible, according to this paper by Chelsio:

Chelsio paper

So I will have to leave my r320 as a storage server, which is what is reality.

In that paper there is a list of compatible hardware such as servers and mainboards.

I think I'll buy an R220, which seems to be compatible.

Regards.


----------



## freejlr (Oct 11, 2022)

Well, getting the T520-CR to work, but when I color the SFP module it is impossible to access it, it is simply "invisible". Surely it is some compatibility problem or who knows what.

https://forums.freebsd.org/threads/ip-and-routing-table-sfp-module.86687/

I have written to technical support about this issue a few days ago, I doubt they will answer me.

So I leave this topic ends here for my part, it has only been a waste of time and money. All problems from the first moment.

The final solution is to put my ISP's router in bridge mode and lift the PPP session from em0.

Regards and thanks..


----------



## freejlr (Oct 13, 2022)

Well, I'll try to find an SFP card that can "talk" with the SFP module, it has to be the problem, which I can't confirm.


----------



## freejlr (Oct 18, 2022)

Apparently the SFP module only accepts 1 byte reads only. So you can read it in this thread.

LINK

I don't know if the FreeBSD driver supports that type of reading, how would I know? In some list of the driver?

I have synchronization problems at least that's what I can see, from the cxgbe(4)driver manual:



> > hw.cxgbe.autoneg
> 
> 
> Link autonegotiation settings.  This tunable establishes the de-
> ...



It gives me to understand that if I get a -1 it is that autonegotiation is not possible and the module will not be able to work

And it is effectively the result I get, this is an output of the kernel state:



> $ sysctl -a |grep autoneg
> hw.cxgbe.autoneg: 1
> 
> dev.cxl.1.autoneg: -1
> dev.cxl.0.autoneg: 1



Being port 1 where the SFP is connected, if I exchange the port SFP the same thing happens, port zero becomes -1 and port one becomes 1.

My loader.conf:



> if_cxgbe_load="YES"
> hw.cxgbe.autoneg=1
> dev.cxl.0.autoneg=1
> dev.cxl.1.autoneg=1



But apparently the Chelsio T520-CR card and the module cannot be set to the same speed. These are the speeds supported by the card.



> $ ifconfig -m cxl1
> 
> cxl1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
> options=6ec07bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,LRO,VLAN_HWTSO,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6,HWRXTSTMP,NOMAP>
> ...



According to chelsio’s paper the T520-CR supports the IEEE802.3z coding. But according to ifconfig it doesn’t support the *1000baseLX *standard which is what the module is supposed to use.

What gives me to understand that the card is not designed to use a single fiber module if not multiple, according to the standard.

Gigabit Ethernet

Which gives me to understand all those failures, forgetting the possible problem with reading a single byte of the module.

What do you think?


----------



## freejlr (Oct 21, 2022)

Apparently the card does recognize the module, it just wasn’t executing the correct options:

`ifconfig -vvvm cxl0`



> cxl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
> options=6ec07bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,LRO,VLAN_HWTSO,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6,HWRXTSTMP,NOMAP>
> capabilities=6ec07bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,LRO,VLAN_HWTSO,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6,HWRXTSTMP,NOMAP>
> ether 00:07:43:33:a2:00
> ...



We can see some values such as the speed of the module, the temperature and the voltage, apparently the vendor and the SN do not appear correctly.

I think the problem may be in the DUMP, I think that in the link I shared they talk about it, on the other hand I can't put the card at the same speed as the module.

Has anyone come up with something?


----------



## freejlr (Nov 5, 2022)

Apparently there is a tool to view and debug cxbge. But I still can't get the module to work, but with this tool I was able to identify it and see, for example, that the ifconfig dump does not correspond to the i2c port:


`cxgbetool t5nex0 modinfo 0`


> ID: SFP/SFP+/SFP28
> Vendor CarlitoxxPro
> SN CP202003180114
> PN V2801F
> ...



And this is when I read the i2c that does not correspond to the ifconfig dump the first 3 bytes:

`cxgbetool t5nex0 i2c 0 0xa0 0....3`


> 0x3 [3]
> 0x4 [4]
> 0x0 [0]



This tool also has filtering, but I don't know how it works, I go back to the start according to the controller, I have synchronization problems, I don't know what else to do. If it is a definite compatibility problem or a bad adjustment on my part, but according to the manufacturer you only have to assign it an IP address and it will work.


----------

