This is going to sound dumb, but what order does the C preprocessor execute tasks in? (First includes, then defines etc)

This sounds dumb, but when the C preprocessor executes tasks as it reads source code, what order does it process the tasks in -- for example, does it handle include files first, then defines, then macros etc?

I know it all gets done eventually, but it would seem the order defines what is seen. If defines are done first and includes are inside a define, then they never get read. If I were building my own preprocessor, what order should I execute steps in:

  • Include files
  • Convert everything except quoted strings to lower case
  • Strip comments
  • Do defines/not-defines

Or is this really my fault for putting to many "compiler tasks" into the pre-processor? Is the correct answer "Don't make the pre-processor do anything other than includes and defines"

reddit.com
u/Rich-Engineer2670 — 3 days ago

Looking for a network simulation platform -- looking between CML and EVE-Pro

The subject says it all -- I need for work, a way to simulate a network that could be 40-50 nodes/sites. For now, I'm just testing certain concepts so I don't need to test the entire model. I'm trying to decide between:

  • Cisco CML Plus
  • Eve-NG Pro

I've used EVE-NG before, and I've also tried Containerlab. I have to support at least Cisco routers (not so much the switches right now) and Mikrotik RouterOS devices. Since I need the Cisco images anyway, I'll have to pay for CML, but do I need EVE-NG on top of it. Questions arise such as:

  • I've got a server for it -- 128GB of RAM, 16 core, 6TB of disk, GbE (we're not testing speed at the moment, just configuration rules and routing)
  • Assume I have the Cisco CML images -- can CML also handle things lilke Mikrotik CHR or Fortinet/Arista/Juniper
  • Can EVEV-NG handle the CML images
  • It shouldn't matter, but I will need to support some form of automation, but that's more the routers themselves
  • Web access to the simulator

What would people do here? I can pay for it, or both, but what would you use?

reddit.com
u/Rich-Engineer2670 — 12 days ago

OK, here's where I ask for my christmas present from Santa

We'll see if I'm good enough to get it.....

What I'm looking for:

  • Until Mikrotik can release a multi-port, multi-gig fanless router....
    • 8 SFP+ ports or better
    • fanless
    • Can run RouterOS
    • Supports simple routing filters and one or two wireguard tunnels
    • 3 ISP connections (on the SFP+ ports) two of which are 2Gb/s, one at 1Gb/s

Until a router exists, does a switch exist for this -- or, do I just make it easier and get a cheap server and run CHR with a couple of 4-port 10Gb cards.

reddit.com
u/Rich-Engineer2670 — 14 days ago

Open Source ISP monitoring tool (iperf3, blocked ports etc)

Subject says it all.... we're trying out new ISPs between sites. Are there any recommended open source toos that allow us to:

  • Iperf3 performance between two sites (as we meeting our goals at the 95% level over a rolling 30 days)
  • Make sure the ISPs aren't blocking certain ports
reddit.com
u/Rich-Engineer2670 — 24 days ago
▲ 1 r/it

A test to AI or not AI -- what we actually found

Everyone's talked about it -- it's been hyped and heaped... we wondered ourselves. What was the outcome, at least for us....

The test:

We have a virtual CPU for a product. We designed the instruction set and we needed an assembler, linker and loader. "Let's see what Claude does...."

Abandoning financial discipline, we didn't care about the token costs, what did we actually get:

Step 1 : Semi-vibed

Well, short answer, it produced "something" like what we wanted. But took a lot of repetition ot get anything close to correct. This is not Claude's fault -- it only know what we tell it we want. But all of those runs weren't cheap folks. In addition, the code we got back, was about, well.... 85% valid. Parts didn't compile, parts were just plain wrong.

It was fine if we gave it little tasks such as "Write me a Golang method that builds a symbol table for labels and their addresses". But due to context limitations, large chunks of code often went off the rails somewhere -- silently. We found out later.

Test 2: The Full Specification

Selling our manager's soul, we wrote a FULL spec, for what we wanted as if we were handing it off to a contract programming team. We fed that in pieces to Claude. It did a lot better, albeit our manager may have to sell a limb or two. This is also no surprise as the request is highly constrained and documented to death. Still not perfect, but a lot closer.

Test 3: The Old Fashioned Way Like Mamma Used to Code

In both test cases 1 and 2, the code, even when it worked, was often unmaintainable. For short tasks and small apps, no problem, but for larger projects, we found we couldn't really patch the code later on -- we'd be back in the prompt loop and our manager was running out of limbs.

What we found:

If you're writing "one page apps" it's great. If you're writing code snippets and you want to know how something COULD be done -- great. But in the end, we actually lost time becuase we had to rewrite or change what Claude gave us.

We ended learning from the code, but rewriting it all the old fashioned way.

reddit.com
u/Rich-Engineer2670 — 27 days ago

Latest Mikrotik wireless ethernet bridge -- real world results?

I've got a customer with 1Gb fiber at one location and a workshop set about 300ft away from the house. Assuming a good sunny day, no trees, and a direct shot, what can I reasonably expect from the wireless bridge.

I know we're talking radio here, so there will be limits, but given 1Gb input and 300 ft. what do people actually see with this device or should I tell him to trench fiber. I know have both 60GHz and Wifi 6 models.

If it were cheap enough, I might use it in the house -- I have one room that cannot have ethernet added to it (risk of water damage from external walls), so a wireless ethernet bridge would solve it -- It's only about 75 feet so I imagine anything will work :-)

reddit.com
u/Rich-Engineer2670 — 2 months ago

I hope a simple netwatch question and script state

I hope this is simple at least....

Assume I have used Netwatch to monitor link states between multiple WAN interfaces. To keep things simple here, I have three WAN interfaces 1, 2, and 3. We start out with our preferred interface WAN1. If it goes down, we switch to WAN2, and if that's down, WAN3.

I see how the up and down scripts can send e-mail as WAN links go up and down, but don't I need some sort of "state". If WAN1 goes down, I get the email, and move to WAN2. But now WAN1 comes back up -- I don't want to get e-mails every 10 minutes for example telling me the WAN1 is still up.

Don't I need some sort of state between scripts so we know nothing has changed? I'd imagine if this were code, a global variable CURRENT_WAN that I could check. The flow would be something like:

  • Start out with WAN1 -- announce it's up via e-mail for example
  • So long as it says up, just keep checking every so often
  • If it fails, announce it's down, and move to WAN2 and say it's up
  • So long as it's up and WAN1 is down, keep checking
  • If WAN2 goes down, move to WAN3
  • If at any time, WAN1 comes back switch to it and consider it our current WAN
reddit.com
u/Rich-Engineer2670 — 2 months ago
▲ 1 r/wifi

GLInet Flint3 vs Mikrotik "be" unit for Wifi 7

For those wondering, until I can get the Mikrotik "be" unit, I've been trying out the Flint3 from Glinet.

Why am I moving to the MIkrotik -- well, that's a separate story, but short an sweet, the Mikrotik RouterOS can do very strange things -- it's a full router and bridge so you have VLANs, tunnels, EVPN.... and I have certain use cases for it -- but it's not out yet, so for the moment, I'm using the Flint3.

What it does well:

  • In MLO mode, I really can't get 1.2Gb/s on an IPhone 17 Pro Max, and above that on a PC. About 50% than it's Wifi6 mode.
  • The advanced mode lets me get below the GUI to do certain types of automation -- not pretty, but you can get into things like VLANs
  • Price -- I was able to pick up a pair for $270 US at Amazon.
  • Supposedly, it can run DDWRT but I've not tried it

What it does not do well:

  • In router mode, I've had no issues, but in access ppoint mode, it can just lock up everuy so often, so it needs a monthly reboot
  • "Splitting the bands" (5/6 is used for WIFI6 and MLO, 2.4GHz for IOT) really doesn't work well, it's a "do this our way" unit.
  • No virtual AP --OK, maybe I'm the only one who needs this, but in Mikrotik, I literally create four virtual APs (IOT/Guest, House, MLO, Lab) off the radios. Each has its own routing, VLANs etc

Verdict:

  • Home users who use it "out of the box" as intended -- a buy
  • Business users -- the lock up problem is an issue. Until this is fixed, avoid it.
  • Lab -- I would not
reddit.com
u/Rich-Engineer2670 — 2 months ago

Has anyone seen a silent 2Gb symetric upgrade?

I'm not complaining mind you but after literally months of Comcast Business failing to even meet 1/10 of that, and their saying it's my router, they can't deliver the speeds I'm paying for to my area, etc. we finally dragged fiber and now have 2Gb symmetric service here (boss paid). I figured since Comcast just hit me with a $200 price increase I might as well use it as a backup.

Well, short story, silent upgrade I guess -- the same service that "couldn't get 1Gb" and "couldn't work with the Mikrotik router (on the 10Gb port), suddently is giving 2Gb up and down.

Again, I'm not complaining but I'm wondering if Comcast did a silent upgrade in the SF Bay Area.

reddit.com
u/Rich-Engineer2670 — 2 months ago

Need a better version of NAT masquerading

Subject says it all....

One machine has two ISPs with two default routes A and B. For various reasons, despite what the default interfaces are, I need a way to:

  • When I'm using default route A, I have a src-nat rule to a specific WAN IP
  • When I'm using default rotue B, I have to use src-NAT rule to a DIFFERENT specific WAN IP B

What I'd like to do is have two src-NAT rules, each with its own IP and port, but they are selected via which path we're using on the way out? Any ideas?

reddit.com
u/Rich-Engineer2670 — 2 months ago
▲ 31 r/ipv6

Dumb question: On IPv6, if I'm not using SLAAC, can I use something smaller than a /64

OK -- a really dumb question. Assume I have a case where I am not using SLAAC -- everything is set with static IPv6 addresses.

Must I use a /64 on interface, or can I have, for example /80s per interface. Since now SLAAC is used, I'd assume it would actually work?

reddit.com
u/Rich-Engineer2670 — 3 months ago

What do I need for a local LLM with these features?

If I want to build a local LLM and I have the following, what do you suggest:

  • I have two machines -- one is my workstation (24 cores, 64GB RAM, 4GB Nvida card. One server 128GB RAM, 16 cores, 4GB Nvidia graphics (2 2GB cards).
  • 2.5Gb network but I can upgrade to 10Gb if needed
  • I don't need graphics, text is fine
  • Can I cluster the machines such that the 24-core machine can also make use of the 16 core machine and its RAM
  • API driven (Go in my case)

What would you use as "the stack". I'm starting from zero, so I can use anything. I don't need it for a specific task yet -- I'm just learning. I do have Jetbrains AI's for code, but they're separate here. I might unless my 17 old grandson on it (via a VPN) who will no doubt feed every aeronautics fact he can find into it.

reddit.com
u/Rich-Engineer2670 — 3 months ago

Am I solving this the wrong way? How would you solve this? (2 ISPs with their own V4/V6 prefixes) to one network)

I may be making this harder than it needs to be:

What I have:

  • Two ISPs, each of which has their own V4 and V6 static prefix range they've given me. How I wish I could just use one range with BGP....
  • Two routers (in this case Mikrotik 5009s), each of which handles one ISP
  • ISP-A is fiber at 2Gb. ISP-B is tunneled at 1Gb. So we want to prefer ISP-A
  • They feed into a single LAN many hosts, some of which have two interfaces, most only have one. Many of the hosts are NATEd
  • Some hosts have a public IP range -- I'd like it form both ISP-A and ISP-B because I don't know which ISP the client will choose -- they could conenct via ISP-A or ISP-B

Outbound is easy --if it's NATed, just pick the preferred default route via routing metric right? But what about incoming traffic. Does it even matter if the packet goes out the other ISP? If they come in on ISP-A and for whever reason I switch to B, the packet still goes out.

How would you solve this? What I've tried on an Ubuntu server:

  • First solution -- severs have two Ethernet interfaces, one to each ISP router. But as expected, that appears to just pick a default route at random or at best, via the metric.
  • Netplan has routes for each ISP, and source-route rules -- somewhat better but clumsy and it just clutters up the routing table it still appears to pick a defualt route at random. And, netplan complains it sees multiple default V4 and V6 routes to the default even though they're in different tables.
  • This is really ugly but it should work -- have three edge routers -- ISP-A, ISP-B and NAT (which forwards to ISP-A or ISP-B router). Each host just has one default route to one of the three routers. Since each host knows only one default, the problem goes away -- but it's not really solved at all.
reddit.com
u/Rich-Engineer2670 — 3 months ago
▲ 6 r/ipv6

This SHOULD work but I can only have ONE IPv6 address/prefix on Ubuntu

OK -- before I lose what little sanity I have.... this SHOULD work, but doesn't. Here is the netplan file I have for Ubuntu. Notice one IPv6 address is oommented out. It doens't matter which one I comment out, but if both are active, at random, only one works. If I comment out one, the other routes. I THOUGHT I had source routing rgiht.... I guess not.

network:
  version: 2
  renderer: networkd
  ethernets:
    enp4s0:
      dhcp4: false
      dhcp6: false
      addresses:
        - 10.0.1.2/16
        - 50.154.105.131/28
        - 199.181.204.131/25
        - 2001:55d:9080::0a00:0102/64
        #- 2602:805:A000::0a00:0102/64
      gateway4: 10.0.0.2
      gateway6: 2001:55d:9080::1
      nameservers:
        addresses:
        - 10.0.1.1
      routes:
        - to: default
          via: 50.154.105.129
          table: 100
        - to: default
          via: 199.181.204.129
          table: 101
        - to: default
          via: 2001:55d:9080::1
          table: 102
        - to: default
          via: 2602:805:A000::1
          table: 103
      routing-policy:
        - from: 50.154.105.128/28
          table: 100
        - from: 199.181.204.128/25
          table: 101
        - from: 2001:55d:9080::/64
          table: 102
        - from: 2602:805:A000::/64
          table: 103

What I THINK this says is (ignoring V4 which works), if the source address is 2602:805:A000::/48, route to 2602:805:A000::1. If it's 2001:55d:9080::/48 route to 2001:55d:9080::1. BUT....l.

This is Ubuntu 26.04 desktop. So if you want to win the Dodge Desoto with Groucho Marx, say the secret words here -- I've been saying a lot secret words, but it's frustrating so I can't say any of them in public.

reddit.com
u/Rich-Engineer2670 — 3 months ago

Ugly, but will this work

The 2Gb fiber is installed, but it has its quicks.

  • It's SFP+ to me, it expects to hand me IPs via a /30 and /126.
  • I run it through a 2Gb switch and I'll send it through a 5009. This means SFP+ comes in, and the 5009, captures the internal IPs of the /30 and /126. It then puts them on its SFP+ port
  • Now, on that SFP+ I have the /28 and /48 as expected
  • One of those /28s feeds yet another 5009 which sets up two GRE tunnels. (Primary and backup). It captures the returned IPs, and sends them to the same switch the SFP+ of the first 5009. Now at THAT switch, I have all captured IPs, the /28 and /48 from the fiber link, and the /24 and /40 from the GRE tunnel
  • That switch feeds internal nodes INCLUDE (gag!) a THIRD 5009, which does things like NATing when needed

Please tell me there's a better way. A /28 and /48 from fiber and a /24 and /40 from GRE, have to go internal and possibly be NATed. In the old days, I would have a server running VMWare, and one or more instances of the CHRs -- what is the thing to do today?

reddit.com
u/Rich-Engineer2670 — 3 months ago

A Mikrotik switch/router with multiple 2.5Gb ports?

After the great flow control debate, when the fiber was installed, we were able to prove (shock!), Comcast has problems. The fiber connection, does not. The fiber comes in to a 2.5Gb switch on the SFP+ port, and then 2.5 connections go to two Mikrotik RB5009s. (One is for special tunnels).

It would be nice if I had a switch/router from MKT that could take multiple 2.5Gb connections, then the tunnel RB5009 could just feed the switch which would do basic layer-3 firewall work to systems downstream. The 5009 could just concentrate on tunnels and leave the filtering to the node downstream.

Is there such a device right now, and, for example, can it layer-3 rules (no encryption, no tunnels, just access rules at 2.5Gb).

I have a setup right now, where the 5009 feeds a 4011.

reddit.com
u/Rich-Engineer2670 — 3 months ago

OK -- some progress, but more questions than answers....

What we have:

  • New RB5009 with a 2Gb copper connection on ether1 (7.22.2)
  • New 6A cables
  • New 2Gb with switch 10Gb uplink
  • Either
    • 10Gb connection on SFP+ port to SFP+ port on a 2Gb switch (the port is 10Gb of course). 5009 ports are NOT using a bridge (makes no difference if they are)
    • 1Gb copper on ether2 to 2Gb switch via 2Gb port
  • What we see
    • If we're using the 2Gb/1Gb copper arrangement, I'd expect to see around 1Gb/385 from the ISP. I get about 650/385. (CPU flow control on)
    • With CPU flow control OFF, it's around 250'/385

HELP! I have no idea what's going on! The Mikrotik forum folks suggest I turn flow control off and then fix the CPU frequency at 1400Mhz. For what it's worth, if I take a laptop and correct it directly to the cable modem, I get the expected 2Gb/365 or so as expected. When I run it through the Mikrotik, I get the throughput loss.

To verify things, I've even done a truly default config -- no change. To absolutely confirm if it's the Mikrotik, I'll try a 2.5Gb router as an alternate.

reddit.com
u/Rich-Engineer2670 — 4 months ago

I'm not sure if I'm in the right place for this but I was wondering if there's a solution for IPv6 portability.

In V4, ugly as it is, we had NAT so if you switched providers, your internal addresses never knew about it. In v6, there is no NAT (thank God), but it makes moving ISPs a pain. What I imagined, such as it is --

  • When you go to your RIR, they have a new question -- basically, are you an ISP who can do all of the items we do today, BGP, RPKI etc. If so, no changes. If not:
  • We get your your portable V6 allocation and an ASN -- no changes. You don't have to do the other items, because the RIR fills it all out autoamtically.
  • You choose your ISP and they give you a "provider ID"
  • You give your new ISP your ASN and a one-time code (much like phone number portability) and it "transfers" the BGP for that ASN to their control.
  • When you decide to change, you get the new provider ID and give them your ASN
  • They can look up that ASN at the RIR and find your still with ISP-A.
  • They (ISP-B) send you a key, you give that ISP-A to say "transfer contorl to ISP-B"

Is this crazy?

reddit.com
u/Rich-Engineer2670 — 4 months ago

I'm not sure what I want to do works the way I imagine, but then agian, people question my imagination all the time 😄

  • I happen to be using a Mikrotik RB5009 software release 7.22.2
  • I have two GRE tunnels to transit providers available to me
  • I was hoping to have tunnel1 connect to ISP1 and its BGP announcements and tunnel2 to ISP2 and its announcements
  • That seems OK -- it's multi-homed BGP and one gets pre-pended BUT
    • If GRE tunnel1 goes down, OK, I'd lose the announcements from BGP1. BGP2 would eventually take over
    • If GRE tunnel2 goes down, same thing
  • But what if I have this

BGP1. BGP2
|tunnel1 | tunnel2
Router1 --- link -Router2

If I'm on default, everything gtoes to BGP1 though tunnel1, and router2 gets its traffic from router1 over link.

If BGP1 or tunnel1 fails, BGP will send everything to router2 and it has to know to reach router1 via the link. In effect, how does Router1 know Router2 is handling the routes via itself or vice versa.

I'm trying to have two BGP announcement points from two ISPs to two routers across the country. Each router also has a private link to he other. If I had large enough blocks, say a /16, I could give each router a sub block and let its sister router handle the other block by default, but my V4 is only a /24. (I have more than enough V6)

reddit.com
u/Rich-Engineer2670 — 4 months ago

OK, I clearly don't understand the use of the RB5009 switch chip.... What I'm trying to do:

  1. WAN port: 2Gb/s over copper (ether1)
  2. LAN (SFP+ to 2Gb switch) or 1Gb on ether2 over copper
  3. I've tried it both with no conifugration (no switch setup) and the default configuration

What I get:

  • If I try to use the 2Gb->SFP+ with and without default configurations, with a 2Gb connection, I see perhaps 450Mb down and 355Mb up
  • If I use the copper connection ether1<->ether2 (no SFP+, pure copper), things improve, but it's still quite variable
  • If I just take a test laptop and connect it directly over 2Gb copper to the cable modem, I get the expected speeds

I've replaced the cables (cat6), the 5009 itself, and the switch.

So, assuming I am clueless, how would YOU do the following:

  • Latest RB5009 w. 7.22.3
  • 2.5Gb 24 port switch with two 10Gb ports and 24 2.5 ports
  • ISP providing 2Gb over copper
  • Test laptop has 2Gb copper
  • The switch can be connected via SFP+ cable between switch and RB5009 or copper

How would yuou set this up using SFP or copper-to-copper? I had imagined, but I'm probably wrong, that I could remove all ports on the bridge and the bridge itself and just two ether1 and ether2 as separate interfaces (or ether1 and SFP+) -- it seemed to work in the past. And, I hate to even ask this, but I'm waiting for the 2Gb fiber install... If Mikrotik can't do it until issues are fixed, what do people recommend that can? For example, can a Protectli box running OpnSense do this reliably, or can CHR running under a VM?

reddit.com
u/Rich-Engineer2670 — 4 months ago