You are not logged in.

#1 2009-07-21 09:57:39

Alberto Ferreira
Member
Registered: 2008-10-08
Posts: 41

Can't configure network manually [SOLVED]

Hi, I'm sorry for bothering but I've wasted 2 hours trying to configure my network manually with a static IP address and I can't.

I used dhcp configuration and it worked great but I really wanted to configure my network manually.

I have several computers all connected with static IP addresses to a router, which IP is 10.0.0.138


I've followed the guide in the wiki and put in rc.conf this:

HOSTNAME="Bluebird"
eth0="eth0 192.168.1.67 netmask 255.255.255.0 broadcast 192.168.1.255"
INTERFACES=(eth0)
gateway="default gw 10.0.0.138"
ROUTES=(!gateway)

# When I remove the "!" from the gateway i get siocdelrt and siocaddrt errors
hosts:

127.0.0.1 Bluebird.domain.org localhost.localdomain localhost Bluebird

resolv.conf:

nameserver 10.0.0.138
nameserver 127.0.0.1
search Bluebird.domain.org

What is a nameserver? I don't understand that neither the "search localdomain" :s

Thanks for your time

Last edited by Alberto Ferreira (2009-07-21 23:15:50)

Offline

#2 2009-07-21 10:10:06

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Can't configure network manually [SOLVED]

The ip address specified in eth0= must be in the same subnet as your router's IP address. 192.168.1.67 with netmask 255.255.255.0 is not in the same subnet as 10.0.0.138. For static addressing, you must specify a gateway i.e. you have to remove the "!".

A nameserver is another name for a DNS (Domain Name Service) server - it translates domain names like archlinux.org into IP addresses like 66.211.213.17. The resolv.conf man page explains the seach parameter.

You should do some more reading about network basics.

Offline

#3 2009-07-21 12:52:35

Alberto Ferreira
Member
Registered: 2008-10-08
Posts: 41

Re: Can't configure network manually [SOLVED]

Thanks tomk but I didn't understand if the netmask or the ip adress must be in the same subnet as the router. From what I read the subnet is the ?.xxx.?.? portion of the IP.

I always used the 192.168.1.67 for my static IP and it worked fine
When I want to configure my router i go to 10.0.0.138 so I assume this is my router ip and the address I should use as gateway.



This is what I get with dhcp (that works):

resolv.conf:

search lan
nameserver 192.168.1.254

hosts:

127.0.0.1 Bluebird.domain.org localhost.localdomain localhost Bluebird

ifconfig -a (only the important parts):

eth0:
inet addr:193.168.1.67 Bcast:192.168.1.255 Mask:255.255.255.0
eth1:
.............
lo:
inet addr:127.0.0.1 Mask:255.0.0.0

Offline

#4 2009-07-21 14:32:48

GerBra
Forum Fellow
From: Bingen/Germany
Registered: 2007-05-10
Posts: 206

Re: Can't configure network manually [SOLVED]

Sorry for no good english..

You have a routing problem using your static ip setup of eth0 and when the gateway/router is in an other network than eth0.
Setting eth0 to 192.168.1.67 a net route (192.168.1.0) is created for you, so you could reach all hosts in the subnet 192.168.1.0 (ex. 192.168.1.1) without a package has to go over a router/gateway.
But your gateway is also on an other subnet (10.0.0.138) - your machine has no information how to reach this host cause you could only address 192.168.1.0 addresses. This will lead to the "iocdelrt and siocaddrt errors" when
enable the gateway route.

You have to specify also a network route which tolds the kernel gow it could reach 10.0.0.138 before this IP could act as a default gateway.
So best use this setup in rc.conf:

HOSTNAME="Bluebird"
eth0="eth0 192.168.1.67 netmask 255.255.255.0 broadcast 192.168.1.255"
INTERFACES=(eth0)
gatenet="-net 10.0.0.0  netmask 255.0.0.0 dev eth0"
gateway="default gw 10.0.0.138"
ROUTES=(gatenet gateway)

The gatenet route tolds your kernel how (on which device) he could reach your router and the gateway route set your router as the default gw.

Offline

#5 2009-07-21 16:40:52

Alberto Ferreira
Member
Registered: 2008-10-08
Posts: 41

Re: Can't configure network manually [SOLVED]

Thanks a lot GerBra! It worked like a charm wink big_smile

Offline

#6 2009-07-22 15:02:35

alienman
Member
From: Mexico
Registered: 2008-07-08
Posts: 106

Re: Can't configure network manually [SOLVED]

I've never seen that gatenet, it's excellent to have knowledge about that, because it seems very useful.

Thanks GerBra


ISC - Ignacio Marmolejo
ArchLinux & GNOME User.

Offline

#7 2009-07-22 23:10:37

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Can't configure network manually [SOLVED]

FYI - gatenet is an arbitrary name chosen by GerBra. He could have called it anything, as long as the same name was used in the ROUTES array e.g.

banana="-net 10.0.0.0  netmask 255.0.0.0 dev eth0"
gateway="default gw 10.0.0.138"
ROUTES=(banana gateway)

Offline

#8 2009-07-23 05:25:33

alienman
Member
From: Mexico
Registered: 2008-07-08
Posts: 106

Re: Can't configure network manually [SOLVED]

Thanks tomk for making that clear, now I have a better understanding of networking in linux, really guys thanks to you anyone can learn a lot around here.


ISC - Ignacio Marmolejo
ArchLinux & GNOME User.

Offline

Board footer

Powered by FluxBB