WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Network wizard in Core ?  (Read 15593 times)

Offline remus

  • Sr. Member
  • ****
  • Posts: 371
Network wizard in Core ?
« on: March 07, 2012, 08:54:05 PM »
Hi all,

I'm wondering if there is a text based wizard for setting network settings, like the one in the tinycore control panel ?

If there isn't I'm guessing, I could just run the tinycore network wizard, and let it produce the settings I need, and then copy them into a microcore environment.

thoughts and comments appreciated :)
Live long and prosper.

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11704
Re: Network wizard in Core ?
« Reply #1 on: March 07, 2012, 09:01:05 PM »
Hi remus
The Tinycore network wizard just produces a script like the following:
Code: [Select]
#!/bin/sh
pkill udhcpc
ifconfig eth0 192.168.1.30 netmask 255.255.255.0 broadcast 192.168.1.255 up
route add default gw 192.168.1.1
echo nameserver 192.168.1.1 > /etc/resolv.conf
echo nameserver 192.168.1.1 >> /etc/resolv.conf
I would just use that as template and modify the numbers as required.
If you run this script as a regular user, you may have to add  sudo  to some/all of the commands.

Offline Lee

  • Hero Member
  • *****
  • Posts: 645
    • My Core wiki user page
Re: Network wizard in Core ?
« Reply #2 on: March 08, 2012, 11:12:53 AM »
I just started throwing together a script that will work pretty much like the cpanel "Network" applet but in a terminal.  If anyone else has already done so, or actually knows what they are doing with such things (or if the Network applet is really just a front end for an existing script that I don't know about?), let me know.  Otherwise, I'll continue - perhaps coming up with something suitable for inclusion in base.
32 bit core4.7.7, Xprogs, Xorg-7.6, wbar, jwm  |  - Testing -
PPR, data persistence through filetool.sh          |  32 bit core 8.0 alpha 1
USB Flash drive, one partition, ext2, grub4dos  | Otherwise similar

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11704
Re: Network wizard in Core ?
« Reply #3 on: March 08, 2012, 11:32:06 AM »
Hi Lee
The /usr/bin/network applet does not appear to be a front end for a script. If you examine the binary, near the end
you'll see the commands it uses to create the configuration script, update bootlocal.sh, etc.

Offline Lee

  • Hero Member
  • *****
  • Posts: 645
    • My Core wiki user page
Re: Network wizard in Core ?
« Reply #4 on: March 08, 2012, 12:23:21 PM »
Thanks Rich.

And thanks to the community for not beating us up about this... I'll plead that I still spend waaay too much time on closed source systems but - I just now thought to go and snarf the source from

http://distro.ibiblio.org/tinycorelinux/4.x/x86/release/src/fltk_projects/network/

Its all object-oriented-lookin' but at least I'll get it right.  :)
32 bit core4.7.7, Xprogs, Xorg-7.6, wbar, jwm  |  - Testing -
PPR, data persistence through filetool.sh          |  32 bit core 8.0 alpha 1
USB Flash drive, one partition, ext2, grub4dos  | Otherwise similar

Offline remus

  • Sr. Member
  • ****
  • Posts: 371
Re: Network wizard in Core ?
« Reply #5 on: March 21, 2012, 03:08:35 AM »
Thanks for your advice Rich,

I have a static ip address in MicroCore 3.8.4 with the following method.

I've added the following instruction to the start of "/opt/bootlocal.sh"
Code: [Select]
sudo sh /opt/eth0.sh &

My "/opt/eth0.sh" file contains the following
Code: [Select]
#!/bin/sh
pkill udhcpc
ifconfig eth0 10.1.1.202 netmask 255.0.0.0 broadcast 10.255.255.255 up
route add default gw 10.1.1.1
echo nameserver 10.1.1.1 > /etc/resolv.conf

I had to add the following to "/opt/.filetool.lst"
Code: [Select]
opt/eth0.sh
And finally I had to run
Code: [Select]
filetool.sh -b
Live long and prosper.

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11704
Re: Network wizard in Core ?
« Reply #6 on: March 21, 2012, 09:29:26 AM »
Hi remus
Not to quibble, but don't you mean:
Code: [Select]
ifconfig eth0 10.1.1.202 netmask 255.255.255.0 broadcast 10.1.1.255 up

Offline remus

  • Sr. Member
  • ****
  • Posts: 371
Re: Network wizard in Core ?
« Reply #7 on: March 21, 2012, 07:17:49 PM »
Hi Rich,

Quote
ifconfig eth0 10.1.1.202 netmask 255.255.255.0 broadcast 10.1.1.255 up

I seem to recall that I got the netmask and broadcast settings by running ifconfig from microcore while it was in dhcp client mode (<- did I say that right ?)

The only part of the IP at work that changes is the forth octet, so the 10.1.1. is static.

I know where you are coming from though, I'll run ipconfig from a few windows computers and see what they are doing, and I'll double check my memory by booting up a few systems with a stock mc cd and run ifconfig
Live long and prosper.

Online curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11050
Re: Network wizard in Core ?
« Reply #8 on: March 22, 2012, 08:26:28 AM »
10. is a class A network, so the original netmask and broadcast were correct. Though no reason you couldn't subnet it to just 256.
The only barriers that can stop you are the ones you create yourself.

Offline remus

  • Sr. Member
  • ****
  • Posts: 371
Re: Network wizard in Core ?
« Reply #9 on: June 06, 2012, 09:42:48 PM »
I've not yet spent much time learning about network theory, i've always been trying to get something working, and then having to move onto the next project, without the time to reflect on what was done, and learning the theory that relates to it. I hope that i'll get some down time eventually. And learn about network theory.

This looks helpful.
http://www.tcpipguide.com/free/t_IPDefaultSubnetMasksForAddressClassesABandC.htm
Live long and prosper.