This content originally appeared on DEV Community and was authored by Mahbub Ferdous Bijoy
copy and rsync command:
- To copy a file over from local host to a remote host:
$ $ scp myfile.txt username@remotehost.com:/remote/directory
- To copy a file from a remote host to your local host:
$ scp username@remotehost.com:/remote/directory/myfile.txt /local/directory
- To copy over a directory from your local host to a remote host:
$ scp -r mydir username@remotehost.com:/remote/directory
- rsync files on the same host:
$ rsync -zvr /my/local/directory/one /my/local/directory/two
- rsync files to local host from a remote host:
$ rsync /local/directory username@remotehost.com:/remote/directory
- rsync files to a remote host from a local host:
$ rsync username@remotehost.com:/remote/directory /local/directory
simple server command :
- run simple python server command :
$ python -m SimpleHTTPServer
here is network routing comamnd:
- Look at your machine's routing table:
$ route -n
Gateway
If we are sending a packet that is not on the same network, it will be sent to this Gateway address. Which is aptly named as being a Gateway to another network.
Genmask
This is the subnet mask, used to figure out what IP addresses match what destination.
Flags
UG - Network is Up and is a Gateway
U - Network is Up
Iface
This is the interface that our packet will be going out of, eth0 usually stands for the first Ethernet device on your system.
- add a new route :
$ sudo route add -net ip_address/cidr gw ip_addresss
$ ip route add ip_address via ip_address
- delete any route :
$ sudo route del -net 192.168.2.1/23
$ ip route delete 192.168.2.1/23
network config command:
- network config command :
$ ifconfig
$ ipconfig
$ ifconfig -a [to see more details]
- To create an interface and bring it up:
$ ifconfig eth0 192.168.2.1 netmask 255.255.255.0 up
- To bring up or down an interface:
$ ifup eth0
$ ifdown eth0
- To show interface information for all interfaces:
$ ip link show
- To show the statistics of an interface:
$ ip -s link show eth0
- To show ip addresses allocated to interfaces:
$ ip address show
- To bring interfaces up and down:
$ ip link set eth0 up
$ ip link set eth0 down
- To add an IP address to an interface:
$ ip address add 192.168.1.1/24 dev eth0
- To obtain a fresh IP:
$ sudo dhclient
network manager command :
- There are also command-line tools to interact with NetworkManager:
$ nm-tool
- The nmcli command allows you to control and modify NetworkManage:
$ nmcli
- we lookup a MAC address with ARP command:
$ arp
- You can also view your arp cache via the ip command::
$ ip neighbour show
network troubleshoting command :
- One of the most simplest networking tools is
ping
$ ping hostName or ip_address
$ ping google.com
$ ping -c google.com
- The
traceroute
command is used to see how packets are getting routed. It works by sending packets with increasing TTL values, starting with 1:
$ traceroute hostName or Ip_address or google.com
- An extremely useful tool to get detailed information about your network is netstat. Netstat displays various network related information such network connections, routing tables, information about network interfaces and more:
$ netstat
$ netstat -at
- utility to debug TCP/UDP sockets:
$ nc
- we can be used to test remote connectivity on ports by using
telnet
command:
$ telnet
-
mtr
is a mix of ping and traceroute. It also provides additional information like intermediate hosts and responsiveness:
$ mtr
here all DNS related linux command:
- The /etc/hosts file contains mappings of some hostnames to IP addresses:
$ cat /etc/hosts
- The "name server lookup" tool is used to query name servers to find information about resource records:
$ nslookup DNSname or ip_address
- Dig (domain information groper) is a powerful tool for getting information about DNS name servers:
$ dig DNSname or ip_address
This content originally appeared on DEV Community and was authored by Mahbub Ferdous Bijoy
Print
Share
Comment
Cite
Upload
Translate
Updates
There are no updates yet.
Click the Upload button above to add an update.
APA
MLA
Mahbub Ferdous Bijoy | Sciencx (2024-09-30T16:52:21+00:00) Day-6: Network Troubleshooting, Network config, Dns. Retrieved from https://www.scien.cx/2024/09/30/day-6-network-troubleshooting-network-config-dns/
" » Day-6: Network Troubleshooting, Network config, Dns." Mahbub Ferdous Bijoy | Sciencx - Monday September 30, 2024, https://www.scien.cx/2024/09/30/day-6-network-troubleshooting-network-config-dns/
HARVARDMahbub Ferdous Bijoy | Sciencx Monday September 30, 2024 » Day-6: Network Troubleshooting, Network config, Dns., viewed ,<https://www.scien.cx/2024/09/30/day-6-network-troubleshooting-network-config-dns/>
VANCOUVERMahbub Ferdous Bijoy | Sciencx - » Day-6: Network Troubleshooting, Network config, Dns. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/09/30/day-6-network-troubleshooting-network-config-dns/
CHICAGO" » Day-6: Network Troubleshooting, Network config, Dns." Mahbub Ferdous Bijoy | Sciencx - Accessed . https://www.scien.cx/2024/09/30/day-6-network-troubleshooting-network-config-dns/
IEEE" » Day-6: Network Troubleshooting, Network config, Dns." Mahbub Ferdous Bijoy | Sciencx [Online]. Available: https://www.scien.cx/2024/09/30/day-6-network-troubleshooting-network-config-dns/. [Accessed: ]
rf:citation » Day-6: Network Troubleshooting, Network config, Dns | Mahbub Ferdous Bijoy | Sciencx | https://www.scien.cx/2024/09/30/day-6-network-troubleshooting-network-config-dns/ |
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.