Pages

Jul 6, 2010

unix based: simple network command

These are simple network command when handling with unix based os:

1. ifconfig -a 

this command is simmilar to ipconfig in windows. It will shows the details of the interfaces exist on the machine, the ip address,netmask,gateway etc.

2. ifconfig eth0 up

to enable/disable certain interface , use this command. above command will enable eth0 interface. To disable it just enter command ifconfig eth0 down.

3. sudo ifconfig eth0 192.168.117.55 netmask 255.0.0.0

above is an example to assign ip address to interface eth0 with ip address 192.168.117.55 and it netmask 255.0.0.0.

4. ifconfig eth0

to show details of only certain interface, use this command. in this example only details of eth0 will be shown.

5. sudo route add default gateway 192.168.18.2

add a default gateway for the machine.

6. sudo nano /etc/resolv.conf

to add the dns, use this command to edit the ip address of the dns using nano text editor.

7. sudo apt-get update

this command use to update the local apt cache

8. sudo apt-cache

search for update package

9. sudo apt-get install {package name}

to install the package

10. sudo /etc /init.d /networking {start/stop/restart}

to start stop or restart the network

11. sudo nano /etc /network /interfaces

alternatively you can edit the network details using nano by using this command.

No comments:

Post a Comment

Related Posts with Thumbnails