WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Static ip/netmask/broadcast on switch (no router)  (Read 3629 times)

Offline Evangelos

  • Newbie
  • *
  • Posts: 19
Static ip/netmask/broadcast on switch (no router)
« on: June 05, 2011, 02:37:09 PM »
I have 3 machines on a switch. How can I give them ip/netmask and broadcast?
Evangelos Brachos

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Static ip/netmask/broadcast on switch (no router)
« Reply #1 on: June 05, 2011, 02:40:19 PM »
Use the network setup button in the control panel.

Offline Evangelos

  • Newbie
  • *
  • Posts: 19
Re: Static ip/netmask/broadcast on switch (no router)
« Reply #2 on: June 05, 2011, 03:28:00 PM »
OK thanks!

Do I have to insert something into the

/opt/bootlocal.sh

In order to keep my changes forever?

p.s. another question, why it says ping: unknown protocol icmp
« Last Edit: June 05, 2011, 03:38:42 PM by Evangelos »
Evangelos Brachos

Offline Lee

  • Hero Member
  • *****
  • Posts: 645
    • My Core wiki user page
Re: Static ip/netmask/broadcast on switch (no router)
« Reply #3 on: June 05, 2011, 04:10:08 PM »
Quote
p.s. another question, why it says ping: unknown protocol icmp

Oh, that's just to annoy users who think they know what they are doing.  :)

More seriously, one of the extensions is apparently superseding  the busybox ping command with a broken  version.

Code: [Select]
tc@apollo:~$ which ping
/usr/local/bin/ping
tc@apollo:~$  ping www.google.com
ping: unknown protocol icmp.
tc@apollo:~$
tc@apollo:~$
tc@apollo:~$
tc@apollo:~$ /bin/ping www.google.com
PING www.google.com (74.125.93.105): 56 data bytes
64 bytes from 74.125.93.105: seq=0 ttl=53 time=43.320 ms
64 bytes from 74.125.93.105: seq=1 ttl=53 time=43.587 ms
64 bytes from 74.125.93.105: seq=2 ttl=53 time=43.634 ms
^C
--- www.google.com ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 43.320/43.513/43.634 ms
tc@apollo:~$
tc@apollo:~$
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 Evangelos

  • Newbie
  • *
  • Posts: 19
Re: Static ip/netmask/broadcast on switch (no router)
« Reply #4 on: June 05, 2011, 04:51:12 PM »
Why everytime I reboot, I have to do again
the

ifconfig eth0 192.168.0.11 netmask 255.255.255.0 up

?

Is there any way to keep this IP ? can I put this command on a script to run on startup?
« Last Edit: June 05, 2011, 05:21:22 PM by Evangelos »
Evangelos Brachos

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: Static ip/netmask/broadcast on switch (no router)
« Reply #5 on: June 05, 2011, 05:38:41 PM »
As the appropriatey named "Run Commands during Startup or Shutdown" Wiki-page (and countless threads in this forum) explains: add your commands to '/opt/bootlocal.sh' (or '/opt/bootsync.sh') and ensure that you perform a backup before shutdown.

PS: A bit of searching through the Wiki pages and this forum is kind of expected before raising this sort of questions that one could expect that many others have asked before ...
« Last Edit: June 05, 2011, 05:41:46 PM by maro »

Offline Evangelos

  • Newbie
  • *
  • Posts: 19
Re: Static ip/netmask/broadcast on switch (no router)
« Reply #6 on: June 05, 2011, 05:48:14 PM »
I tried in two ways:

1) inserted ifconfig eth0 192.168.0.11 netmask 255.255.255.0 up in to the bootlocal.sh

2) insert /opt/eth0.sh with the ifconfig eth0 192.168.0.11 netmask 255.255.255.0 up
on bootlocal.sh to load on startup.

Everytime  I did backup but after the reboot, no eth0!!!only lo with the ifconfic command appear.
then the ifconfig eth0 192.168.0.11 netmask 255.255.255.0 up
worked, but I wanted on startup.
Evangelos Brachos

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: Static ip/netmask/broadcast on switch (no router)
« Reply #7 on: June 05, 2011, 06:17:12 PM »
Are you making sure that there is no DHCP client running when it comes to executing the 'ifconfig' command? What can be found when running the 'network' GUI tool (and saving it's configuration) is that the freshly created '/opt/eth0.sh' script first off kills the 'udhcpc' process. BTW, the same result could be achieved via the 'nodhcp' boot code.

Another thought is that (at least theoretically) the 'eth0' device might not be ready at the time the 'ifconfig' command gets executed. You might find that out by producing a 'dmesg' entry prior to the 'ifconfig' execution (e.g. by inserting echo 'Starting /opt/bootlocal.sh' > /dev/kmsg as the first command in '/opt/bootlocal.sh') and checking what 'eth0' related messages are showing up in the 'dmesg' output after this marker.



EDIT: Correction of a typo
« Last Edit: June 06, 2011, 12:54:57 AM by maro »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11265
Re: Static ip/netmask/broadcast on switch (no router)
« Reply #8 on: June 05, 2011, 06:33:10 PM »
Quote
Are you making sure that there is no DHCP client running when it comes to executing the 'ipconfig' command?

Didn't you mean  ifconfig ?
 
EDIT: Disregard this post, previous post corrected.
« Last Edit: June 06, 2011, 09:07:04 AM by Rich »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14585
Re: Static ip/netmask/broadcast on switch (no router)
« Reply #9 on: June 05, 2011, 08:28:51 PM »
p.s. another question, why it says ping: unknown protocol icmp

Because /etc/protocols is missing - there's a full version in the iana-etc extension or you can put something smaller yourself.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Static ip/netmask/broadcast on switch (no router)
« Reply #10 on: June 06, 2011, 02:07:33 AM »
Quote
Are you making sure that there is no DHCP client running when it comes to executing the 'ipconfig' command?

Didn't you mean  ifconfig ?
 

Out of my head 'ipconfig' would be the equivalent to 'ifconfig' on other operation system(s).
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Evangelos

  • Newbie
  • *
  • Posts: 19
Re: Static ip/netmask/broadcast on switch (no router)
« Reply #11 on: June 06, 2011, 04:43:22 AM »
I am going to connect my PCs directly to the router. because I think that I could not fix this problem.


thanks for all guys.
Evangelos Brachos