Solaris – add a default route
To add a default route simply use the following syntax, echo default-route-IP > /etc/defaultrouter
To add a default route simply use the following syntax, echo default-route-IP > /etc/defaultrouter
To enable the DNS resolver client on Solaris, follow these steps, Change the line in the file /etc/nsswitch.conf that reads “hosts: files” to hosts: dns files Add the following line to the file /etc/resolv.conf. If the file doesnt exsist, create one. nameserver [DNS IP]
The version of sed on Solaris cannot actually save the file. So as a work around just type ‘perl -pi -e’ instead of the sed command : perl -pi -e ’s/who/when/g’ /tmp/afile
Below are some of the common uses and commands for sed that I have come across over the years, Find and Replace sed -i ‘s|arp|/sbin/arp|g’ /etc/init.d/proxyarp Find and Delete sed -e ‘/^$/d’ file.txt Remove Multiple words This will remove word, word1, or word2 from the file input.txt sed ‘s/word\|word1\|word2//g’ input.txt Change the first instance on … Read more
To add a interface you need to do the following, 1. Confirm what the mac address is by running ifconfig -a 2. Then edit the relevant script , which can be found at /etc/sysconfig/network-scripts/ifcfg-eth0. The script can be ifcfg-eth1, ifcfg-eth2 etc etc. 3. And it should look something like this (for a static IP), … Read more
Solaris Prevent DoS /usr/sbin/ndd -set /dev/tcp tcp_conn_req_max_q 1024/usr/sbin/ndd -set /dev/tcp tcp_conn_req_max_q0 2048/usr/sbin/ndd -set /dev/tcp tcp_time_wait_interval 60000/usr/sbin/ndd -set /dev/ip ip_respond_to_echo_broadcast 0/usr/sbin/ndd -set /dev/ip ip_forward_directed_broadcasts 0 Disable redirects /usr/sbin/ndd -set /dev/ip ip_ignore_redirect 1/usr/sbin/ndd -set /dev/ip ip_send_redirects 0 Disable Source routing /usr/sbin/ndd -set /dev/ip ip_forward_src_routed 0 Linux Kernal 2.2 Prevent DoS /sbin/sysctl -w net.ipv4.tcp_max_syn_backlog=1280/sbin/sysctl -w net.ipv4.vs.timeout_timewait=60/sbin/sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1 … Read more
IP forwarding is the process of forwarding packets from one network to another. Below shows the necessary steps to enable/disable IP forwarding. Solaris Enable IP Forwarding ndd -set /dev/ip ip_forwarding 1 Disable IP forwarding ndd -set /dev/ip ip_forwarding 0 Check the status ndd -get /dev/ip ip_forwarding Linux Kernel If the output is 1 IP forwarding … Read more
O – On processor — the process is executing on the CPU in either user or system mode. R – Runnable — the process is on a run queue and is running or runnable. S – Sleeping — the process is waiting for a I/O event to complete. Z – zombie — process, terminated but … Read more
In this example we will configure interface qfe1 with the an IP of 192.168.1.1 255.255.255.0 and set the speed to 100 full duplex. Bring up the Interface To bring up and plumb the interface, we first need to type the following, (change the IP to yours) ifconfig qfe1 plumbifconfig qfe1 192.168.1.1 netmask 255.255.255.0 up Update … Read more
In order to mount a hard drive we need to add an entry to the file /etc/fstab. This entry will allow us to not lose our drive mounting after a system reboot. /dev/sdb1 /mypartition ext3 defaults 0 0 Then to action the changes run the following command, root@server:/# mount -a Finally check that the drive … Read more
Below will grep for all files containing the word ssh at the beginning of the line. The BOL symol is ^. grep -r ^ssh /etc
Here’s a quick overview of Syslog, there’s much more to it and you can find tons more information in the links at the bottom of the page. Syslog stands for the System Log protocol. It allows for the sending and receiving of event messages and alerts across an IP network. Operating on either UDP or … Read more
To add the route, use the following syntax, /usr/sbin/route add host [destination ip] [via ip] Then add this as well to your routes script (so it survives a reboot) in the /etc/rc?.d, i normally just do a find for the routes file in /etc. find /etc -name *routes* If there isnt one then you will … Read more
Here is our hand-picked selection of the best courses you can find online:
UNIX Administration Fundamentals
Vim Masterclass
and our recommended certification practice exams:
AlphaPrep Practice Tests - Free Trial