LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   What does ifup do to bring up an interface? (https://www.linuxquestions.org/questions/linux-networking-3/what-does-ifup-do-to-bring-up-an-interface-460398/)

crazyjimbo 07-02-2006 07:09 PM

What does ifup do to bring up an interface?
 
Hi there, mostly out of curiosity, I've been playing around with my wireless connection and trying to create a simple program to scan networks and connect to whichever one I choose. This doesn't directly tie in with my question, but when trying to bring up a connection manually, I'm having trouble and I don't think I'm doing everything needed. ifup works seemlessly and gives me a nicely configured wireless interface with the ESSID and such things all set automatically.

So what stages does ifup go through to get to that stage? I'm using Debian which seems to have an executable program for ifup whereas by googling it appears that other distros have a script to do it. This would be handy as I could just have a peek myself. If anyone has an ifup script that would do nicely :).

The manpages for ifup make referance to it using ifconfig and route, which makes sense. I have a feeling it is the routing part I am not doing correctly. Also, does it detect that it is configuring a wireless interface and also use iwconfig to set things up?

Does it get the ESSID and access point information via DHCP once it is connected or some other means (perhaps by scanning and picking the first/strongest access point?)

Sorry for the long waffle, I think you should gather the sort of information I'm looking for by now. Any help would be much appreciated.

Thank You, James

tgo 07-04-2006 01:00 AM

Most wireless routers are set to dhcp. Those scritpts you talk about only need to be a few lines just to set the interfaces ip, default gateway, and dns server. If you were on what most default wireless routers give something like this should work

-----------
ifconfig eth0 192.168.1.180
route add default gw 192.168.1.1
echo nameserver 192.168.1.1 > /etc/resolv.conf
--------------

the first line sets eth0s ip ( its set to a high ip as to stay out of the most likely dhcp pool range to avoid conflicts ).
the second line would route all the traffic through the router
the third line sets your dns server.

you dont really need much more then that for a simple connection.


All times are GMT -5. The time now is 04:53 PM.