Results 1 to 2 of 2
First off in windows I can use this command to see all responding IP's
connected to ie the switch or router.
Code:
FOR /L %i IN (1,1,254) DO ping -n ...
- 01-26-2011 #1Just Joined!
- Join Date
- Jan 2011
- Posts
- 93
Resolve IP adress and ipconfig alternative
First off in windows I can use this command to see all responding IP's
connected to ie the switch or router.
It will neatly save all to a txt file in the root of c.Code:FOR /L %i IN (1,1,254) DO ping -n 1 192.168.0.%i | FIND /i "Reply">> c:\ipaddresses.txt
How can I do that via terminal in Linux?
Also how can I manage all the thing I have been using ip config for earlier in windows? I am aware of dhclient which I belive will be kind of ipconfig /release, and
I have found ifconfig which I am not too sure how to use.
- 01-27-2011 #2Just Joined!
- Join Date
- Mar 2007
- Location
- Bogotá, Colombia
- Posts
- 39
Well, if you want to make pure pings and find out which stations reply them, you can use a similar loop to the one you use in windows, something like this:
for N in `seq 1 254` ; do ping -c 1 192.168.0.$N ; done | grep "192.168.0" | egrep -vi "unreachable|statistics|ping" > networkips.txt
Although that might take some time. You should take a look at nmap, it will also let you know which open ports each station has:
nmap 192.168.0.0/24 > network.txt
Finally, if you want to configure an IP with ifconfig you have to do something like this:
ifconfig <your interface> 192.168.0.10 netmask 255.255.255.0
and then add you gateway:
route add default gw 192.168.0.1
if you do this you interface will be ready, but you won't be able to resolve anything through DNS, so add you favorite DNS server to /etc/resolv.conf with the following syntax:
nameserver xxx.yyy.zzz.www
and your ready to surf the web


Reply With Quote