Friday, October 31, 2014

Ubuntu network comandline


check configuration of network
ifconfig

ipaddr

Start stop service
sudo /etc/init.d/networking restart
sudo /etc/init.d/networking start
sudo /etc/init.d/networking stop


configuring network ip address

nano /etc/network/interfaces

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address 192.168.1.2
        network 192.168.1.0
        netmask 255.255.255.0
        broadcast 192.168.1.255
        gateway 192.168.1.1


Stop the network interface eth0:

ifdown eth0

Start the network interface eth0:

ifup eth0

Don't confuse with the following command, which restarts all the networks services :

/etc/init.d/networking restart

To see your various network interfaces, use the command:

/sbin/ifconfig -a