linux new command sip

2
SysVinit to Systemd Cheatsheet (2014/09/10) BM Shukla Linux New Commands ip, dig, systemctl (replacement of old commands ifconfig & route ip, nslookupdig, service &chkconfig systemctl) Task ifconfig/route ip Show all NICs ifconfig ip addr show Show specific NIC ifconfig eth0 ip addr show eth0 Disable NIC ifconfig eth0 down ip link set eth0 down Enable NIC ifconfig eth0 up ip link set eth0 up Assign IP ifconfig eth0 [IP] netmask [NM] ip addr [IP]/[CIDR] dev eth0 Show routing table route netstat -r ip route Set standard route route add default gw [IP] eth0 ip route add default via [IP] Of course ip has a lot of more features – just a few of them: Enable/disable MTU and Promiscuous Mode Configure Multicasting and VLANs ARP table maintenance Similar to ifconfig – nslookup is also obsolete for a long time. There are two replacement tools that are able to do more: host and dig. The open DNS server bind advises not to use nslookup (source ): Due to its arcane user interface and frequently inconsistent behavior, we do not recommend the use of nslookup. Use dig instead. Here are some commonly used nslookup commands and their dig pendants. Task nslookup dig Forward lookup nslookup google.de dig google.de dig +short google.de Reverse lookup nslookup [IP] dig -x [IP] dig +short -x [IP] Use specific DNS server nslookup google.de [DNS] dig @[DNS] google.de dig @[DNS] +short google.de Ask for MX records nslookup -query=mx google.de dig google.de MX dig +short google.de MX Specific timeout nslookup -timeout=42 google.de dig google.de +time=42 dig +short google.de +time=42

Upload: pavankalluri

Post on 07-Nov-2015

222 views

Category:

Documents


0 download

DESCRIPTION

liux

TRANSCRIPT

  • SysVinit to Systemd Cheatsheet (2014/09/10) BM Shukla Linux New Commands ip, dig, systemctl (replacement of old

    commands ifconfig & route ip, nslookupdig, service

    &chkconfig systemctl)

    Task ifconfig/route ip Show all NICs ifconfig ip addr show Show specific NIC ifconfig eth0 ip addr show eth0 Disable NIC ifconfig eth0 down ip link set eth0 down Enable NIC ifconfig eth0 up ip link set eth0 up Assign IP ifconfig eth0 [IP] netmask [NM] ip addr [IP]/[CIDR] dev eth0

    Show routing table route netstat -r ip route

    Set standard route route add default gw [IP] eth0 ip route add default via [IP]

    Of course ip has a lot of more features just a few of them:

    Enable/disable MTU and Promiscuous Mode Configure Multicasting and VLANs ARP table maintenance

    Similar to ifconfig nslookup is also obsolete for a long time. There are two replacement tools that are able to do more: host and dig. The open DNS server bind advises not to use nslookup (source):

    Due to its arcane user interface and frequently inconsistent behavior, we do not recommend the use of nslookup. Use dig instead.

    Here are some commonly used nslookup commands and their dig pendants.

    Task nslookup dig

    Forward lookup nslookup google.de dig google.de dig +short google.de

    Reverse lookup nslookup [IP] dig -x [IP] dig +short -x [IP] Use specific DNS server

    nslookup google.de [DNS] dig @[DNS] google.de dig @[DNS] +short google.de

    Ask for MX records nslookup -query=mx google.de dig google.de MX dig +short google.de MX

    Specific timeout nslookup -timeout=42 google.de dig google.de +time=42 dig +short google.de +time=42

  • Sysvinit Command Systemd Command Notes

    service httpd start systemctl start httpd.service

    Used to start a service (not reboot persistent)

    service httpd stop systemctl stop httpd.service

    Used to stop a service (not reboot persistent)

    service httpd restart systemctl restart httpd.service

    Used to stop and then start a service

    service httpd reload systemctl reload httpd.service

    When supported, reloads the config file without interrupting pending operations.

    service httpd condrestart systemctl condrestart httpd.service

    Restarts if the service is already running.

    service httpd status systemctl status httpd.service

    Tells whether a service is currently running.

    ls /etc/rc.d/init.d/ systemctl list-unit-files --type=service (preferred) ls /lib/systemd/system/*.service /etc/systemd/system/*.service

    Used to list the services that can be started or stopped Used to list all the services and other units

    chkconfig httpd on

    systemctl enable httpd.service Turn the service on, for start at next boot, or other trigger.

    chkconfig httpd off systemctl disable httpd.service

    Turn the service off for the next reboot, or any other trigger.

    chkconfig httpd systemctl is-enabled httpd.service Used to check whether a service is configured to start or not in the current environment.

    chkconfig --list systemctl list-unit-files --type=service(preferred) ls /etc/systemd/system/*.wants/

    Print a table of services that lists which run levels each is configured on or off

    chkconfig httpd --list ls /etc/systemd/system/*.wants/httpd.service

    Used to list what levels this service is configured on or off

    chkconfig httpd --add systemctl daemon-reload

    Used when you create a new service file or modify any configuration

    Note that all /sbin/service and /sbin/chkconfig lines listed above continue to work on systemd, and will be translated to native equivalents as necessary. The only exception is chkconfig --list.

    Additional commands In SysVinit, services can define arbitrary commands. Examples would be service iptables panic, or service httpd graceful. Native systemd services do not have this ability. Any service that defines an additional command in this way would need to define some other, service-specific, way to accomplish this task when writing a native systemd service definition. Check the package-specific release notes for any services that may have done this. *[root@st2 drbd.d]# systemctl enable drbd.service

    ln -s '/usr/lib/systemd/system/drbd.service' '/etc/systemd/system/multi-user.target.wants/drbd.service'