Documente Academic
Documente Profesional
Documente Cultură
route
netstat -r
addr show
addr show eth0
link set eth0 down
link set eth0 up
addr [IP]/[CIDR] dev eth0
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:
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
Forward lookup
nslookup google.de
Reverse lookup
nslookup [IP]
Specific timeout
nslookup -timeout=42
google.de
dig
dig
dig
dig
dig
google.de
+short google.de
-x [IP]
+short -x [IP]
Sysvinit
Command
service httpd
start
service httpd
stop
service httpd
restart
service httpd
reload
service httpd
condrestart
service httpd
status
Systemd Command
systemctl start httpd.service
systemctl stop httpd.service
systemctl restart httpd.service
systemctl reload httpd.service
systemctl condrestart httpd.service
systemctl status httpd.service
Notes
Used to start a service (not
reboot persistent)
Used to stop a service (not
reboot persistent)
Used to stop and then start a
service
When supported, reloads the
config file without interrupting
pending operations.
Restarts if the service is already
running.
Tells whether a service is
currently running.
Used to list the services that
can be started or stopped
Used to list all the services and
other units
Turn the service on, for start at
next boot, or other trigger.
Turn the service off for the next
reboot, or any other trigger.
Used to check whether a
service is configured to start or
not in the current environment.
Print a table of services that
lists which run levels each is
configured on or off
Used to list what levels this
service is configured on or off
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'