Desired new sample settings:
= Host IP address
200.87.229.20= Netmask:
255.255.255.252= Network ID:
200.87.229.0= Broadcast IP:
200.87.229.255= Gateway/Router IP:
200.87.229.17= DNS Server: 8.8.8.8
Open network configuration file:
sudo nano /etc/network/interfacesiface eth0 inet dhcpAppend new network settings:
iface eth0 inet static
address 200.87.229.20
netmask 255.255.255.252
network 200.87.229.0 broadcast 200.87.229.255
gateway 200.87.229.17Save and close the file. Restart the network:
$ sudo /etc/init.d/networking restartTask: Define new DNS servers Open /etc/resolv.conf file
$ sudo nano /etc/resolv.conf You need to remove old DNS server assigned by DHCP server:
search myisp.com
nameserver 200.87.229.254 nameserver 8.8.8.8Save and close the file.
Task: Test DNS server
$ host cyberciti.bizNetwork command line cheat sheet You can also use commands to change settings. Please note that these settings are temporary and not the permanent. Use above method to make network changes permanent or GUI tool as described below.
Task:
Display network interface information
$ ifconfigTask:
Take down network interface eth0
/ take a network interface down
$ sudo ifconfig eth0 downOR
$ sudo ifdown eth0 Task:
Bring a network interface eth0 up
$ sudo ifconfig eth0 upOR
$ sudo ifup eth0 Task: Change IP address and netmask from command lineActivate network interface eth0 with a new IP (192.168.1.50) / netmask:
$ sudo ifconfig eth0 192.168.1.50 netmask 255.255.255.0 upTask: Display the routing table
$ /sbin/route OR
$ /sbin/route -nOutput:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface localnet * 255.255.255.0 U 0 0 0 ra0
200.87.229.0 * 255.255.255.0 U 0 0 0 eth0
172.16.236.0 * 255.255.255.0 U 0 0 0 eth1 default 200.87.229.254 0.0.0.0 UG 0 0 0 ra0Task: Add a new gateway
$ sudo route add default gw 172.16.236.0Task: Display current active Internet connections
(servers and established connection)
$ netstat -natTask: Display open ports
$ sudo netstat -tulpOR
$ sudo netstat -tulpnTask: Display network interfaces stats (RX/TX etc)
$ netstat -iTask: Display output for active/established connections only
$ netstat -e
$ netstat -te
$ netstat -tue
Where
- -t : TCP connections
- -u : UDP connections
- -e : Established
Send ICMP ECHO_REQUEST to network hosts, routers, servers etc with ping command. This verifies connectivity exists between local host and remote network system:
$ ping router
$ ping 192.168.1.254
$ ping cyberciti.bizSee simple Linux system monitoring with ping command and scripts for more information.
Task: Use GUI (Graphical Configuration) network Tool If you are new, use GUI configuration tool, type the following command at terminal:
$ network-admin &Above command is Ubuntu's GUI for configuring network connections tool.
Final tip - Learn how find out more information about commandsA man page is your best friend when you wanted to learn more about particular command or syntax. For example, read detailed information about ifconfig and netstat command:
$ man ifconfig
$ man netstat
Just get a short help with all command options by appending --help option to each command:$ netstat --helpFind out what command is used for particular task by searching the short descriptions and manual page names for the keyword:
$ man -k 'delete directory'
$ apropos -s 1 removeDisplay short descriptions of a command:
$ whatis rm
$ whatis netstat



LibreOffice
Firefox
No comments:
Post a Comment