Register
It is currently Tue Oct 21, 2014 3:30 pm

TCP/IP


All times are UTC - 6 hours


Post new topic Reply to topic  [ 7 posts ] 
Author Message
 PostPosted: Thu Feb 07, 2008 2:29 pm   

Joined: Thu Feb 07, 2008 2:21 pm
Posts: 2
Hey there all.
I was wondering if there is anyway to set TCP/IP settings in Bash, such as IP, Subnet Mask, and DNS server.
Thanks in advanced :)

[Also: is there anyway to scan for wifi networks and connect to one via Bash?]


Top
 Profile  
 PostPosted: Fri Feb 08, 2008 4:34 am   

Joined: Tue Feb 05, 2008 8:24 am
Posts: 14
cynic wrote:
Hey there all.
I was wondering if there is anyway to set TCP/IP settings in Bash, such as IP, Subnet Mask, and DNS server.
Thanks in advanced :)

[Also: is there anyway to scan for wifi networks and connect to one via Bash?]


It depends on what OS you use. In GNU/Linux, *BSD etc. you may change network settings with ifconfig (see man 8 ifconfig). route will help to setup routing table (gateway). DNS servers are typically listed in /etc/resolv.conf file.

However, you should refer to the documentation of your OS/distribution. It may happen to offer some distribution-specific tools to configure network (e.g. in Debian there is /etc/network/interfaces file to define all the networking settings in one place).

--
UseFreeTools — my blog about GNU/Linux and Free Software


Top
 Profile WWW  
 PostPosted: Fri Feb 08, 2008 5:03 am   
Moderator
User avatar

Joined: Thu Oct 11, 2007 7:12 am
Posts: 229
Location: London - UK
If your OS not windows you can do almost anything on the command line that can be done in a GUI, and often much more. You need to learn how to use the relevant commands manually first so then you can convert into a script.

Oh and on modern Linux systems you should use the "ip" command rather than "ifconfig", which is slowly being phased out :)


Top
 Profile  
 PostPosted: Fri Feb 08, 2008 7:17 am   

Joined: Tue Feb 05, 2008 8:24 am
Posts: 14
DarthWavy wrote:
Oh and on modern Linux systems you should use the "ip" command rather than "ifconfig", which is slowly being phased out :)


Well, I agree with you. But ifconfig is pretty much everywhere, and iproute2 (ip) only on modern Linux (ipfw in FreeBSD?).

P.S.
cynic wrote:
Also: is there anyway to scan for wifi networks and connect to one via Bash?


I tried this google search: is there any way to scan for wifi networks from command line in linux?

And found this list of: Wireless LAN Sniffer Applications and Scanners for Linux


Last edited by jetxee on Mon Feb 11, 2008 3:18 am, edited 1 time in total.

Top
 Profile WWW  
 PostPosted: Fri Feb 08, 2008 10:01 am   
Site Admin

Joined: Tue May 17, 2005 7:31 pm
Posts: 251
Location: Georgia
hey jetxee... we really don't approve of the "RTFM" mentality. If you don't know an answer right off the top of your head, feel free not to comment (as it's not really helpful). If you know of a website that can help directly, feel free to post that instead. But posting a link to a google search? I think we can do better than that.

cynic - I happened to write a program that does much of what you are looking for I think. It's posted on our "Mother Site" at this location. If you have any questions about it, let me know.

Welcome to Bashscripts.org btw!


Top
 Profile  
 PostPosted: Mon Feb 11, 2008 3:17 am   

Joined: Tue Feb 05, 2008 8:24 am
Posts: 14
jbsnake wrote:
hey jetxee... we really don't approve of the "RTFM" mentality.


OK, I got it. But the answer was given the line below. Personally, I would prefer to have a link to the regularly updated list of similar tools rather than just one random name which came to mind.

I shall edit the previous post to make it clear that the first links points to google. The second one points to the answer.


Top
 Profile WWW  
 PostPosted: Tue Feb 12, 2008 2:02 pm   

Joined: Thu Feb 07, 2008 2:21 pm
Posts: 2
Thanks for the replies guys. I'm trying to make a script to connect to a certain wifi network, but one that needs full TCP/IP settings.

jbsnake wrote:
hey jetxee... we really don't approve of the "RTFM" mentality. If you don't know an answer right off the top of your head, feel free not to comment (as it's not really helpful). If you know of a website that can help directly, feel free to post that instead. But posting a link to a google search? I think we can do better than that.

cynic - I happened to write a program that does much of what you are looking for I think. It's posted on our "Mother Site" at this location. If you have any questions about it, let me know.

Welcome to Bashscripts.org btw!


Heh, I've been lurking this site for a while and am loving it. Thanks for the warm reception ;)


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP