networking


nm-connection-editor - Ubuntu window network settings

ubuntu@ubuntu:~/.ssh$ netstat -atn | more
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:51123           0.0.0.0:*               LISTEN     
tcp        0      0 127.0.1.1:53            0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN     
tcp        1      0 192.168.40.128:54760    162.213.33.49:443       CLOSE_WAIT 
tcp6       0      0 :::111                  :::*                    LISTEN     
tcp6       0      0 :::80                   :::*                    LISTEN     
tcp6       0      0 :::43793                :::*                    LISTEN     
tcp6       0      0 :::4949                 :::*                    LISTEN     
tcp6       0      0 ::1:631                 :::*                    LISTEN     
tcp6       0      0 :::25                   :::*                    LISTEN     
tcp6       0      0 127.0.0.1:80            127.0.0.1:40368         TIME_WAIT  
tcp6       1      0 ::1:43542               ::1:631                 CLOSE_WAIT 

ubuntu@ubuntu:~/.ssh$ 


Open /etc/network/interfaces 
Change the preceding lines to add an IP address, net mask, and default gateway (replace samples with the respective values):
auto eth0
iface eth0 inet static
    address 192.168.1.100
    netmask 255.255.255.0
    gateway 192.168.1.1 
    dns-nameservers 192.168.1.45 192.168.1.46
Restart the network service for the changes to take effect:
$ sudo /etc/init.d/networking restart

ubuntu@ubuntu:~/.ssh$ ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether 00:0c:29:1c:fb:91 brd ff:ff:ff:ff:ff:ff
ubuntu@ubuntu:~/.ssh$ 

ubuntu@ubuntu:~/.ssh$ dmesg | grep eth0 | more
[    2.855144] pcnet32: eth0: registered as PCnet/PCI II 79C970A
[   31.177259] pcnet32 0000:02:01.0 eth0: link up
[ 5772.794000] pcnet32 0000:02:01.0 eth0: link up
[24563.850363] pcnet32 0000:02:01.0 eth0: link down
[24579.868554] pcnet32 0000:02:01.0 eth0: link up



ubuntu@ubuntu:~/.ssh$ ethtool eth0
Settings for eth0:
Cannot get wake-on-lan settings: Operation not permitted
Current message level: 0x00000007 (7)
      drv probe link
Link detected: yes
ubuntu@ubuntu:~/.ssh$ 
---------------------------------------------------------


 If you need to change your network parameters temporarily, you can use the ifconfig and route commands as follows:

  1. Change the IP address and netmask, as follows:
    $ sudo ifconfig eth0 192.168.1.100 netmask 255.255.255.0
    
  2. Set the default gateway:
    $ sudo route add default gw 192.168.1.1 eth0
    
  3. Edit /etc/resolv.conf to add temporary name servers (DNS):
    nameserver 192.168.1.45
    nameserver 192.168.1.46
    
  4. To verify the changes, use the following command:
    $ ifconfig eth0
    $ route -n
    
  5. When you no longer need this configuration, you can easily reset it with the following command:
    $ ip addr flush eth0
    
  6. Alternatively, you can reboot your server to reset the temporary configuration.










Comments

Popular posts from this blog

HAproxy logging

NFS mount add in fstab _netdev instead of default | firewall-cmd --list-all

teamcity Automatic Agent Start under Linux