{"id":56,"date":"2013-03-10T18:43:44","date_gmt":"2013-03-10T17:43:44","guid":{"rendered":"http:\/\/www.morong.info\/?p=56"},"modified":"2019-03-20T14:33:31","modified_gmt":"2019-03-20T13:33:31","slug":"centos-drobnosti","status":"publish","type":"post","link":"https:\/\/www.morong.info\/?p=56","title":{"rendered":"CentOS drobnosti"},"content":{"rendered":"<p>P\u0159evzato z r\u016fzn\u00fdch web\u016f :<\/p>\n<pre>$ ip route show\r\n192.168.91.0\/24 dev eth0\u00a0 proto kernel\u00a0 scope link\u00a0 src 192.168.91.128\r\n169.254.0.0\/16 dev eth0\u00a0 scope link\u00a0 metric 1002\r\ndefault via 192.168.91.2 dev eth0<\/pre>\n<p>&nbsp;<\/p>\n<p><b>In order to change a default gateway to another IP address<\/b>:<\/p>\n<pre>$ sudo ip route replace default via 192.168.91.10 dev eth0<\/pre>\n<p>&nbsp;<\/p>\n<p><b>In order to set a default gateway permanently on CentOS<\/b>, you will need to update \/etc\/sysconfig\/network accordingly.<\/p>\n<pre>$ sudo vi \/etc\/sysconfig\/network<\/pre>\n<p>GATEWAY=192.168.91.10<\/p>\n<p>Again, be aware that the IP addressed specified here should match with the subnet (192.168.91.0\/24) associated with a default route interface.<\/p>\n<p>Another option to set a default gateway persistently on CentOS is to edit \/etc\/sysconfig\/network-scripts\/ifcfg-&lt;default_interface_name&gt;, and add \u201cGATEWAY=&lt;gateway_ip&gt;\u201d there. If the default interface is \u201ceth0\u2033, you will need to edit \/etc\/sysconfig\/network-scripts\/ifcfg-eth0. If you choose to use this method, you need to refer to this post to get familiar with this option.<\/p>\n<p>Whether you edit \/etc\/sysconfig\/network or \/etc\/sysconfig\/network-scripts\/ifcfg-ethX, don\u2019t forget to restart network service as follows, or reboot your CentOS for the change to take effect.<\/p>\n<pre>$ sudo service network restart<\/pre>\n<p>&nbsp;<\/p>\n<p>Na CentOSu sta\u010d\u00ed nainstalovat: <code>bind<\/code>, <code>caching-nameserver<\/code> (<code>yum install<\/code>), upravit soubor <code>\/etc\/resolv.conf<\/code> a nastartovat named (<code>service named start<\/code>).<\/p>\n<p>Test:<br \/>\ndig domena.cz<br \/>\n;; Query time: 130 msec<br \/>\n;; SERVER: 127.0.0.1#53(127.0.0.1)<br \/>\n;; WHEN: Wed Jun 28 12:02:32 2008<br \/>\n;; MSG SIZE\u00a0 rcvd: 165<br \/>\n;; Query time: 1 msec<br \/>\n;; SERVER: 127.0.0.1#53(127.0.0.1)<br \/>\n;; WHEN: Wed Jun 28 12:02:32 2008<br \/>\n;; MSG SIZE\u00a0 rcvd: 165<\/p>\n<p><code>Upravit - nameserver 127.0.0.1 - v resolv.conf<\/code><\/p>\n<p><code>Jak ru\u010dn\u011b nastavit ip adresu p\u0159es dhcp - <\/code><\/p>\n<pre>dhclient eth0<\/pre>\n<p>&nbsp;<br \/>\nJeden z p\u0159\u00edkaz\u016f :<br \/>\n<b>system-config-network<\/b><\/p>\n<p>&nbsp;<\/p>\n<h2>Install shorewall on CentOS or RHEL<\/h2>\n<p>First, <a href=\"http:\/\/www.cyberciti.biz\/faq\/fedora-sl-centos-redhat6-enable-epel-repo\/\">turn on EPEL repo<\/a> and type the following <a href=\"http:\/\/www.cyberciti.biz\/faq\/rhel-centos-fedora-linux-yum-command-howto\/\">yum command to install shorewall package<\/a>:<br \/>\n<code><\/code><\/p>\n<pre># yum install shorewall<\/pre>\n<p>Pokud nenajde yum shorewall &#8211;<\/p>\n<p><b>If you are running an CentOS6\/EL6 version, enter:<\/b><\/p>\n<pre>$ cd \/tmp\r\n$ <a title=\"wget command\" href=\"http:\/\/www.cyberciti.biz\/tips\/linux-wget-your-ultimate-command-line-downloader.html\">wget<\/a> http:\/\/mirror-fpt-telecom.fpt.net\/fedora\/epel\/6\/i386\/epel-release-6-8.noarch.rpm\r\n# rpm -ivh epel-release-6-8.noarch.rpm<\/pre>\n<p><b>If you are running an CentOS5\/EL5 version, enter:<\/b><\/p>\n<pre>$ cd \/tmp\r\n$ <a title=\"wget command\" href=\"http:\/\/www.cyberciti.biz\/tips\/linux-wget-your-ultimate-command-line-downloader.html\">wget<\/a> http:\/\/download.fedoraproject.org\/pub\/epel\/5\/i386\/epel-release-5-4.noarch.rpm\r\n# rpm -ivh epel-release-5-4.noarch.rpm<\/pre>\n<p><b>If you are running an CentOS4\/EL4 version, enter:<\/b><\/p>\n<p>The following may not be supported:<\/p>\n<pre>$ cd \/tmp\r\n$ <a title=\"wget command\" href=\"http:\/\/www.cyberciti.biz\/tips\/linux-wget-your-ultimate-command-line-downloader.html\">wget<\/a> http:\/\/download.fedoraproject.org\/pub\/epel\/4\/i386\/epel-release-4-10.noarch.rpm\r\n# rpm -ivh epel-release-4-10.noarch.rpm<\/pre>\n<p><b>Install epel*.rpm file using yum command<\/b><br \/>\nYou can use the yum command instead of rpm command:<\/p>\n<pre><code># yum install epel-release-6-8.noarch.rpm<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p><b>Test na spr\u00e1vnou funkci :<\/b><\/p>\n<pre><code>arp -a -n|grep 22.254<\/code><\/pre>\n<p>If you see something like<\/p>\n<pre><code>? (192.168.22.254) at 00:c0:f0:3b:4d:eb [ether] on eth0<\/code><\/pre>\n<p>then it&#8217;s up and available, even if it&#8217;s filtering ICMP echo-requests (ping requests).<\/p>\n<p>If you get<\/p>\n<pre><code>? (192.168.22.254) at &lt;incomplete&gt; on eth0<\/code><\/pre>\n<p>then it&#8217;s genuinely down.<\/p>\n<p><strong>Jak nastavit default gateway :<\/strong><\/p>\n<pre><code><b>ip route add default via 192.168.99.254 dev eth0<\/b><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>P\u0159evzato z r\u016fzn\u00fdch web\u016f : $ ip route show 192.168.91.0\/24 dev eth0\u00a0 proto kernel\u00a0 scope link\u00a0 src 192.168.91.128 169.254.0.0\/16 dev eth0\u00a0 scope link\u00a0 metric 1002 default via 192.168.91.2 dev eth0 &nbsp; In order to change a default gateway to another &hellip; <a href=\"https:\/\/www.morong.info\/?p=56\">Cel\u00fd p\u0159\u00edsp\u011bvek <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-56","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.morong.info\/index.php?rest_route=\/wp\/v2\/posts\/56","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.morong.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.morong.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.morong.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.morong.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=56"}],"version-history":[{"count":21,"href":"https:\/\/www.morong.info\/index.php?rest_route=\/wp\/v2\/posts\/56\/revisions"}],"predecessor-version":[{"id":396,"href":"https:\/\/www.morong.info\/index.php?rest_route=\/wp\/v2\/posts\/56\/revisions\/396"}],"wp:attachment":[{"href":"https:\/\/www.morong.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=56"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.morong.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=56"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.morong.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=56"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}