• Category Archives electronics
  • Eliminating bell’s home hub 3000

    I have recently upgraded my internet from VDSL (50/10) to gigabit (500/500) unfortunately this means that I have to use bell as an ISP and that means I needed to use their crappy home hub router/gateway. Initaly just set it up so my existing router would use the bell router as a bridge to talk to bells PPPoE network because I had no way to use the SFP ONT that is registered with their network until recently. my old TP-link consumer grade gigabit router was on its last legs (constantly crashing for no reason). I have been wanting to upgrade my network with a more professional setup and ended up getting a Mikrotik hAP AC router (https://www.amazon.ca/gp/product/B01BMMK4HI)since I wanted to keep the cost down while still having 802.11b/g/n/ac to cover my apartment (if i were in a house I would have gone for a 24 port router with distributed AP’s) and an SFP port and poe injection. Any way the MikroTik routerOS opens a lot of configuration possibilities (and head aches) that normal consumer routers dont offer like bypassing ISP hardware

    Please note: this will not work if you have the TV bundle I have read something about bell using VLAN 37 for this but I do not have a tv subscription so I cant test it

    After a week of tinkering and playing with my new toy I was able to get the router to work on bells GPON using the provided ONT (since it is white listed on their network)

    1. you need to get your LAN configured how you need it dhcp server, wifi, firewall rules, etc.
    2. remove the SFP module and Fiber from your Home hub (open the door on the router where the fiber enters)
    3. install the ONT and Fiber into your SFP when you open the sfp you should see the interface panel in RouterOS you shed see the vendor info
    4. configure a VLAN with ID 35 and set its interface to use the SFP port
    5. setup a PPPoe interface using the B1 username and password from bell you can get this from the bell one bill system (including setting the password)
    6. tell the pppoe to use the VLAN you made earlier as its interface
    7. If all went well you should be online

    bonus: I found that the default MTU is 1480. If I simply increased the MTU to 1520 (to bring the pppoe up to 1500) on the VLAN and SFP the SFP would start fragmenting packets and throwing Rx too long errors I guess it just doesn’t like jumbo packets all that much. I did find that if I brought the MTU to 1512 it would work fine (without errors) and the PPPoe was running at 1492.


  • Networking: a phoned in analogy

    I was trying to explain to some one how in a fairly top level way the internet works and had a hard time going it this morning it hit me everyone know how to call someone and Generally how phones work so i started writing.

    DNS(domain name server):

    You get a phone and a phone number for your company and no one knows that number but everyone know your company’s name. So to tell everyone your phone# you call up the company that makes the phone books (authoritative name server and registar) and say my companies phone# is XXX XXX XXXX and to inform the phone operators of this. It takes some time for that company to print the updated list and send it to the operators(dns recurser) around the world. So when someone calls the operator (a known phone number by many many people but not all) and asks for company Y the operator says they should call XXX XXX XXXX to talk to you. However if someone from a different city calls their operator (could be a different number entirely) The operator will check their records and say “hold on for a second let me get that information for you” and call the next towns or even the state operator (root server) (sometimes 2 or 3 other towns) and ask “do you know the phone number for Y?” If they don’t which will do the same as the first operator and ask around, until one of them calls your cities operator and get the phone number of your company. this information will get passed all the way back to the original operator and then the client that made the original request. When each operator got that number they wrote it down to ad to their lisk to known numbers for the next time someone asks for company Y.DDNS: same situation as before but instead you had the cheaper option to not always keep the same phone number and so it will change at random(ish) depending on your phone company (dhcp server) but they will tell the receptionist (gateway router) that number when she calls in to ask for the new number in the morning, could be the same as yesterday but could be different. But she will never tell you (local server) what that number is and will only tell you your extension, unless you go read her notes (network status) so to get around this you call a friend that has caller ID (whats my number) and they tell you the number they see on their end. so you call up the phone book company and tell them your new number so the operator can be told of the change

    DDNS (dynamic domain name server)

    Same situation as before but instead you had the cheaper option to not always keep the same phone number and share one in a pool of rotating phone numbers. And so it will change at randomish intervals depending on your phone company’s policies. The phone company will tell the receptionist (gateway router) that number when she calls in to ask if she has a new number in the morning, could be the same as yesterday but could be different. The receptionist will never tell you (the local server) what that number is and will only tell you your phones extension, unless you go read her notes (network status). So to get around this you call a friend that has caller ID (whats my number) and they tell you the number they see on their end. After that you call up the phone book company (registar) and tell them your new number so the operators can be told of the new change.

    DHCP ( Dynamic Host Configuration Protocol )

    Basically the IT guy who manages the phone numbers to each department or in terms of public numbers the phone company managing and assigning a phone number.

    NAT (network address translation)

    You (the server software) are working for a company (subnet) and have a specific extension (port) in your department which has its own internal phone number (server and hardware IP ). You can be reached at lets say extension 443 and someone is calling the phone number they got from their operator and expects to talk to someone at extension 443 to get the information needed. When the client calls they say to the receptionist (router / firewall) “I need to talk to 443” the client cant directly call those internal department phone numbers. The receptionist was told by her manager if someone asks for 443 to forward the call to the department’s leader( firewall) who yells to the room “who has 443?” you (the server software) answers “I do” so they route the call to you who can then openly talk(packets) to the client. If you are sick (server offline) no one answers however the client keeps asking for information and no one responds. so the client hangs up after a while(time out).

    Port forwarding:

    Same as before someone is calling asking to talk to 443 but your department leader (firewall) hates that number and wont let anyone use it (blocked port) so they give you a different extension like 993 for no reason. the receptionist is told that when she calls a department to say “this client wants to talk to 993” even though they originally asked to talk to 443.

    Firewalls:

    (in a very general sense)

    Outgoing port blocking:

    Just as before someone is calling 443 the receptionist calls your department but because the team lead (firewall) hates 443 he broke the microphone so when you answer the routed call you can hear everything the client says and you keep responding but they cant hear anything back so they hang up (time out). And at each one of the previous steps there is a leader(firewall) who can shutdown the call or send it to a different person along the way if they don’t like something about it (iptables rules).

    Incoming port blocking:

    when a client calls in to speak to extension 022 The firewall tells the client to fuck off (REJECT), He can also not tell anyone that there ever was a call (DROP), or he can send the client to somewhere else entirely(NAT).


  • Blody HDDs

    im sure some of you noticed the server went down quite often in the last month first I downgraded the system to 12.04 LTS in the process I backed up my home folders in a .tar.gz this was my first problem NEVER use tar.gz on critical backups use tar.bz if you need the tarball compressed. Any way I just threw the the tarballs on my older media HDD and when I tried to decompress it it kept getting stuck and when I tried to pull them off the server it would get stuck or transfer very slowly at times and at others it would be at full network speed. Turns out the HDD was not too happy and I knew the drive was throwing up the occasional S.M.A.R.T errors but the drive decided to start having corrupt sectors after I migrated. I recovered as much data as I could but I lost a lot of data including a full user profile and all of the emails stored on it and that had more than a few critical info emails so yeah bad luck on the timing.

    if i had the money to set up a RAID 5 I would but 3 1 TB drives would run me $300 after shiping and I don’t have that kind of money

    TL;DR version
    Dont compress critcal files with tar.gz and dont ignore S.M.A.R.T errors.


  • Server is up and running

    The Bell tech came at about 11  after showing him where I wanted the modem he went on his way testing, 3 minutes later: “The copper is shit so I need to put in a new cable.” so brand new wire to the buildings node (which was recently replaced) FUCK YEAH. About 3 hours later (including a lunch break) we had ADSL sync and internet but slow as hell, reboot the modem got 30ms of latency to local servers 9-13 Mbits down and 0.75-9Mbits up with speedtest

    its a bit slower down link then i would like but im happy with it for now as long as its consistent

     

    The server was finally on the internet as of 16:30 there was an issue with ddclient and name cheap that wasn’t allowing the records to update properly after about an hour of dicking around I deleted all the records for my domain names and rest them up and that fixed it (go figure). So now the minecraft server and mail server are running as well YAY.

     

    speed test to a local server:

    speedtest to one across the country:

     


  • Server move day / internet hookup day

    so on June 13th at some point my new apartment will get internet  and there for the server will go to its new home

    I have added a count down clock in  on the top left of the home page

    ISP details:

    ISP: colba.net (same as I have now but we dont share with any one, so less slow downs and outages)

    type: ADSL2+

    ISP estimated speed: 15Mbits down 0.9-1 Mbits up (we are about 1km from the CO )

    unlimited bandwidth (unlike every other ISP in Canada)

    cost: $458.15 a year (about 29 a month with dry loop)


  • I need a bit of help

    so I got my Atmel xmega-B1 Xplained demo board last week and through the course of the week I have been trying to test it but all I can do with it is play with the pre-programmed stuff on the board because my computers don’t want to recognize the board properly, and unfortunately I don’t have a JTAG programer to do any software testing or even see the debugging info.

    The board only shows up as a generic HMI device when according to the documentation it should automatically show up as an Atmel HMI, a mass storage device, and as a COM port. So far I have tried the demo software installed various drivers that I found on Atmel’s website (windows wont let me use any of them) and even Atmel studio 6 does not want to recognize its existence so if any one has a suggestion please let me know
    I don’t exactly want to do a review of something I cant properly test I would buy a JTAG programmer but I don’t have the money for it right now

    maybe in a few months but not soon


  • Server Down time

    the server will be down this afternoon for about 45 min to 1 hour starting at about 6pm EST

    The last few weeks I have been having server stability issues and kept seeing disk read errors in the logs I initially thought it was a failing hard drive which I then sourced to a faulty SATA cable but that wasn’t the only issue. Fortunately the hard drive is in good health and was working properly when I tested in my desktop but I still kept getting disk read errors I finally sourced it to the drives not getting enough current to run properly when I went to confirm this theory by checking the PSU voltage in the BIOS it was fluctuating between 4.8V and 5.01V so yeh the power supply is on its last leg. once I discovered that I removed all non essential components from the PSU and disabled 2 of the CPU cores which has kept the system running for the last 4 days   I have ordered a new one which came in today and will be replaced tonight.

     

    UPDATE:

    server has its new PSU and has happy voltages across the board and is much quieter than it was before

    UPDATE 2:

    I just realized i forgot to publish this last night DERP


  • Power down, phone dead? Not a problem.

    Since most people don’t own a backup generator (including myself though I would like one). I have been in this situation a few times in the last year  due to a new building going up in my area or fires  or wind between the power generation facility and the city and have lost power for more than a few hours.

    In the longest lasting one I found that my phones battery was pretty close to dead so I pulled out the bread board to remedy that problem my first reaction was to use a lm7805 (datasheet) a 5V regulator  that would have been nice but I didn’t have any at the time (the closest electronics store is a 20 min bike ride away (and there POS terminals would probably be dead anyway) so I couldn’t be bothered but I had a few dozen lm317t’s (datasheet)  a variable regulator

    With the last of my phones battery I  looked up the data sheet (if I had room I would probably keep a print out of all the components data sheets  I own )  and built the circuit with the light from the camera flash

    The equation for the voltage regulator  is  Vout = 1.25v*(1+r2/r1)

    I used a 240 ohm resistor for my r1 so 1.25(r2/240)  and I want a near 5v out put. So 5v=  ((5/1.25) -1) *240=720 and the nearest resistor I have is 750. So 1.25(1+(720/240)) =5.156 close enough! the devices internal regulator can handle an extra 160 mV. In any case its a CMOS logic device so its all 3.3V anyway. I ended up using 2 in parallel to dissipate excess heat (I didn’t have any TO-92 sized heat sinks).

    As for a final product I added some low value caps (.1 uf on the input and a 10 uf on the out put) along with some protection diodes (see final schematic) . I now have it soldered on a perf-board and in an Altoids tin  for use in the future. In fact the last time I went camping I brought it with me  and it came in handy. The first night there  pretty much killed the battery due to the cold night granted the only use I have for my phone was emergency communication and as a time piece (not an issue any more with my pebble).

    lm317 basic

    (please note that the pin numbers are wrong out is pin 2 and adj is 3)

    7805usb

     

    317t final

    (please note that the pin numbers are wrong out is pin 2 and adj is 3)