You are not logged in.

#1 2010-08-08 13:03:15

kriz
Member
Registered: 2009-06-29
Posts: 96

help me making a deamon script for a specific eth0 configuration

hi
my idea is to have a daemon script for configuring my eth0 device with specific settings to connect to my xbox.
i"ve got no idea on how to wirite a daemon script, so i hope to get some help from the community

eth0 sould have:

192.168.1.33  as ip
255.255.255.0 as netmask
192.168.1.1.55  as gateway


„Je verdinglichter die Welt, je dichter das Netz, das der Natur überworfen wurde, desto mehr beansprucht ideologisch das Denken, das jenes Netz spinnt, seinerseits Natur, Urerfahrung zu sein." Theodor W. Adorno [aus: Wozu noch Philosopie]

Offline

#2 2010-08-08 13:13:41

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: help me making a deamon script for a specific eth0 configuration

'man ifconfig' maybe?

Edit: I still haven't may daily fix of coffee, but "192.168.1.1.55  as gateway" shows 5 numbers. IIRC gateway is just an IP, so there should be 4.

Last edited by karol (2010-08-08 13:14:59)

Offline

#3 2010-08-08 15:44:24

jac
Member
From: /home/jac
Registered: 2009-05-19
Posts: 431
Website

Re: help me making a deamon script for a specific eth0 configuration

The network daemon that comes with Arch can handle all of this. There are examples in rc.conf:

#Static IP example
#eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255"

(I think it runs ifconfig anyway, so if you need more options do as karol suggested and man ifconfig)

Last edited by jac (2010-08-08 15:45:38)

Offline

#4 2010-08-08 16:05:27

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: help me making a deamon script for a specific eth0 configuration

you could also just use netcfg which does all that you want.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#5 2010-08-08 23:08:24

kriz
Member
Registered: 2009-06-29
Posts: 96

Re: help me making a deamon script for a specific eth0 configuration

i k'no its possible with network deamon, but its a great investement to uncomment everytime my rc.conf, then /etc/rc.d/network start...
i"m using by default my wireless to connect to internet

don't want to use netcfg. want something like wpa_auto does for wireless conectons, just for eth0 specific settings


„Je verdinglichter die Welt, je dichter das Netz, das der Natur überworfen wurde, desto mehr beansprucht ideologisch das Denken, das jenes Netz spinnt, seinerseits Natur, Urerfahrung zu sein." Theodor W. Adorno [aus: Wozu noch Philosopie]

Offline

#6 2010-08-08 23:11:49

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: help me making a deamon script for a specific eth0 configuration

kriz wrote:

i k'no its possible with network deamon, but its a great investement to uncomment everytime my rc.conf, then /etc/rc.d/network start...
i"m using by default my wireless to connect to internet

don't want to use netcfg. want something like wpa_auto does for wireless conectons, just for eth0 specific settings

You need to uncomment it once and set the correct values. That's it.

Offline

#7 2010-08-09 22:51:41

Noble
Member
Registered: 2010-06-01
Posts: 63

Re: help me making a deamon script for a specific eth0 configuration

You will use route to set the gateway, and ifconfig to set the IP

As root run:

ifconfig eth0 192.168.1.33 netmask 255.255.255.0
route add -net 192.168.1.0 netmask 255.255.255.0 dev eth0

Those who give up their liberty for security,
neither deserve liberty nor freedom,
and they will lose both.
- Benjamin Franklin

Offline

Board footer

Powered by FluxBB