WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: network configuration file and dhcp  (Read 5065 times)

Offline Magil

  • Newbie
  • *
  • Posts: 13
network configuration file and dhcp
« on: December 21, 2009, 08:31:29 AM »
Hello,

I would like to know where i can find the configuration file for the network. I would also like to know how to set a static ip adress in tiny core by changing it in text.I am aware of the Netcardconfig in the desktop but would like to change things manually and be able to change these settings remotely. Can someoen answer my question? Thanks.

Offline combo3

  • Full Member
  • ***
  • Posts: 148
Re: network configuration file and dhcp
« Reply #1 on: December 21, 2009, 09:57:49 AM »
There are no configuration files per se.

The command line syntax is:

ifconfig eth0 192.168.0.100 netmask 255.255.255.0 broadcast 192.168.0.255
route add default gw 192.168.0.1 eth0

You'll also need to create file /etc/resolv.conf for DNS lookups.
That file contains the following items:

nameserver x.x.x.x
nameserver x.x.x.x

where x.x.x.x are your IPs nameserver addresses.

To make life easy, here's a script that you can run at system boot:

Code: [Select]
#!/bin/sh

# Variable Assignment

INTERFACE=eth0
ADDRESS=192.168.0.100
BROADCAST=192.168.0.255
GATEWAY=192.168.0.1
NETMASK=255.255.255.0
NAMESERVER1=8.8.8.8
NAMESERVER2=8.8.4.4

# Bring up the interface

ifconfig $INTERFACE $ADDRESS netmask $NETMASK broadcast $BROADCAST up
route add default gw $GATEWAY $INTERFACE

# Create DNS Lookup File

cat > /etc/resolv.conf <<EOF
nameserver $NAMESERVER1
nameserver $NAMESERVER2
EOF

Substitute the variables to suit your needs.
« Last Edit: December 21, 2009, 11:01:59 AM by combo3 »

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: network configuration file and dhcp
« Reply #2 on: December 21, 2009, 10:04:33 AM »
There is a GUI for such. Control Panel Netcardconfig, or from shell netcardconf
10+ Years Contributing to Linux Open Source Projects.

Offline Magil

  • Newbie
  • *
  • Posts: 13
Re: network configuration file and dhcp
« Reply #3 on: December 21, 2009, 10:07:04 AM »
ah cool, thanks for the fast response, problem solved.  :D