Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: Magil on December 21, 2009, 08:31:29 AM

Title: network configuration file and dhcp
Post by: Magil 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.
Title: Re: network configuration file and dhcp
Post by: combo3 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.
Title: Re: network configuration file and dhcp
Post by: roberts on December 21, 2009, 10:04:33 AM
There is a GUI for such. Control Panel Netcardconfig, or from shell netcardconf
Title: Re: network configuration file and dhcp
Post by: Magil on December 21, 2009, 10:07:04 AM
ah cool, thanks for the fast response, problem solved.  :D