What I meant is, if I do as per your code above, when I enable mode_ap() - all the 3 ethernet ports become LAN. and when I enable mode_router(),1st ethernet port is in WAN mode and other 2 ethernet ports in LAN mode. am I correct ?

I have GL-AR750S-EXT with me.