Sunday, 25 March 2018

Frequent used commands: ASA/Windows/Linux


Frequent used commands: ASA/Windows/Linux

To check which all adapter are up?
sudo -i
sudo mii-tool



To make a http request from a shell?
wget


Some linux commands.
sudo -s : open a root shell
apt-get update : refresh available updates
apt-get upgrade : upgrade all pkgs
apt-get install pkg : install pkg
ifconfig : show network information
iwconfig : show wireless information
sudo /etc/init.d/networking restart : reset network for manual configuration
file /etc/network/interfaces : manual configuration
ifup interface : bring interface online
if down interface : disable interface
ufw enable : turn on fw
ufw disable : turn off fw
ufw default allow : allow all connection by default
ufw default deny : drop all connection by default
ufw status : current status and rules
ufw allow port : allow traffic on port
ufw deny from ip : block ip address
uname -a : get all kernel information




How to configure multiple ip address on same NIC on ubuntu?
ifconfig eth1.11 60.1.1.11/24 up


How to find your router’s ip address ?
MBIDSAR-M-X1PX:~ root# route -n get google.com
   route to: 172.217.8.14
destination: default
       mask: default
    gateway: 72.163.208.1
  interface: en0
      flags: <UP,GATEWAY,DONE,STATIC,PRCLONING>
 recvpipe  sendpipe  ssthresh  rtt,msec    rttvar  hopcount      mtu     expire
       0         0         0         0         0         0      1500         0 
MBIDSAR-M-X1PX:~ root# 

  


How to check DNS server used ?
MBIDSAR-M-X1PX:~ root# nslookup google.com
Server:        72.163.128.140
Address:  72.163.128.140#53

Non-authoritative answer:
Name: google.com
Address: 172.217.8.14

MBIDSAR-M-X1PX:~ root# 



How to open site from terminal?
MBIDSAR-M-X1PX:~ root# open -a firefox -g http://news.google.com
MBIDSAR-M-X1PX:~ root# open -a firefox -g $HOME
MBIDSAR-M-X1PX:~ root# 



How to check Event Viewer logs on windows for RA client?
Right click on computer -> Manage -> system tools -> Event viewer -> windows logs -> Application
check for Ras Client which is VPN client.


How to convert ipv4 to ipv6 ?
convert ipv4 to ipv6
60.1.1.10/24 to 60:1:1::10/96



How to create alias on ASA?
ASA# show run all command-alias
command-alias exec h help
command-alias exec lo logout
command-alias exec p ping
command-alias exec s show


How to configure mac-address on ASA?
int g0/0
mac-address aaaa.1111.333a

To check all vlans configured on switch
Switch#show run vlan


How to check routes on Linux ?
[root@iLnxRTR3 ~]# route -n


How to add ipv4 route in Linux ?
route add -net 192.168.2.0 netmask 255.255.255.0 gw 192.18.1.100


How to reload IOS router ?
boot system disk0:/Image
wr
reload

or
reload save-config no-confirm



Two ways to execute scripts
1. sh name.sh == run time execution, no need for permission to execute
2. ./name.sh absolute path way of execution, need permission to execute



How to turn web server on routers on that we can telnet them.
R#ip http server
line vty 0 4
no login
end


How to configure ip address in linux ?
sudo ifconfig ens33 172.16.121.10 netmask 255.255.255.0


How to configure ip address in windows using CLI?
netsh interface ipv4 show config
netsh interface ipv4 set address name="YOUR INTERFACE NAME" static IP_ADDRESS SUBNET_MASK GATEWAY
netsh interface ipv4 set address name=“xxxxx” static 60.1.1.15 255.255.255.0 60.1.1.1



How to do repeated ping from windows ?
ping 90.1.1.10 -t

How to configure ipv6 address  in windows from cmd ?
netsh interface ipv6 add address "Local Area Connection" 2001:db8:290c:1291::1



How to configure ipv6 address  in Ubuntu /Linux?
/sbin/ip -6 addr add 2001:0db8:0:f101::1/64 dev eth1


How to add static route on Linux host ubuntu ?
route add -net 10.10.10.0 netmask 255.255.255.0 gw 192.168.1.1 dev eth0


To ping ipv6 address
ping6  


How to disable firewall on Linux ubuntu ?
to install ufw
apt-get install ufw
sudo ufw disable
sudo ufw enable : for enable
to check status : sudo ufw status



How to delete route ?
# /sbin/ip -6 route del default via 2001:0db8:0:f101::1


How to add route in win host?
go to start -> Run command line as administrator - >
route add 160.1.1.0 mask 255.255.255.0 180.1.1.10



To add route persistently :
route add 160.1.1.0 mask 255.255.255.0 180.1.1.10 -p


How to connect to website through port using ipv4 and ipv6?
http://180.1.1.10:90
http://[2001:db8:90::2]:90/


No comments:

Post a Comment

Note: only a member of this blog may post a comment.