{"id":137,"date":"2017-01-16T10:27:51","date_gmt":"2017-01-16T12:27:51","guid":{"rendered":"http:\/\/vejas.defas.lt\/?p=137"},"modified":"2017-01-18T08:40:40","modified_gmt":"2017-01-18T10:40:40","slug":"dinaminio-dns-registravimas","status":"publish","type":"post","link":"http:\/\/vejas.defas.lt\/?p=137","title":{"rendered":"Dinaminio DNS registravimas"},"content":{"rendered":"<p>Bernt Cristian Egeland komentaras <a href=\"http:\/\/uavmatrix.com\/viewpost\/2\/62\/116\/0\/PX4-PixHawk\/Setting-Up-Raspberry-Pi-A+-and-USB-3G-Modem%C2%A0\">http:\/\/uavmatrix.com\/viewpost\/2\/62\/116\/0\/PX4-PixHawk\/Setting-Up-Raspberry-Pi-A+-and-USB-3G-Modem%C2%A0<\/a><\/p>\n<p>netinka, kadangi no-ip.com abonentas nemokamas tik pirm\u0105 m\u0117nes\u012f, be to nurodyta konfig\u016bracija neveikia o google nurodo \u012f nekorekti\u0161k\u0105 inadtn client debian paket\u0105. Taigi inadyn pakeyas i\u0161instaliuojamas. <strong>apt-get remove inadyn.<\/strong><br \/>\n<del><span style=\"text-decoration: underline;\"> Next we will install DynDns software which allows us to use a dynamic name to connect our laptop to RPI when using cellular network.<\/span><\/del><br \/>\n<del><span style=\"text-decoration: underline;\"> This is not required if your cell operator gives you static ip adress, but normally they dont.<\/span><\/del><br \/>\n<del><span style=\"text-decoration: underline;\"> So instead of finding your cell IP adress every time, we use Dynamic andress of your choice.<\/span><\/del><\/p>\n<p><del><span style=\"text-decoration: underline;\">There are many DynDns vendors, pick one. \u00a0Im using\u00a0<a href=\"http:\/\/freedns.no-ip.com\/?d=no-ip.info&amp;u=bm8taXAuaW5mby8=\" target=\"_blank\">No-ip<\/a>.<\/span><\/del><br \/>\n<del><span style=\"text-decoration: underline;\"> Create a account and a Host name.<\/span><\/del><\/p>\n<p><del><span style=\"text-decoration: underline;\">Lets say for this tutorial your host (dns) are myairplane.no-ip.info<\/span><\/del><br \/>\n<del><span style=\"text-decoration: underline;\"> Install Inadyn software into RPI which will sync your IP against your dns.<\/span><\/del><br \/>\n<del><span style=\"text-decoration: underline;\"> Type this syntax<\/span><\/del><\/p>\n<p>&nbsp;<\/p>\n<p><del><span style=\"text-decoration: underline;\"><span class=\"pln\">apt<\/span><span class=\"pun\">&#8211;<\/span><span class=\"kwd\">get<\/span><span class=\"pln\"> install inadyn<\/span><\/span><\/del><\/p>\n<p>&nbsp;<\/p>\n<p><del><span style=\"text-decoration: underline;\">Then we need to change the config to match our account at No-Ip<\/span><\/del><\/p>\n<p><del><span style=\"text-decoration: underline;\"><span class=\"pun\">\/<\/span><span class=\"pln\">etc<\/span><span class=\"pun\">\/<\/span><span class=\"pln\">inadyn<\/span><span class=\"pun\">.<\/span><span class=\"pln\">conf<\/span><\/span><\/del><\/p>\n<p><del><span style=\"text-decoration: underline;\">If the file above do not exists, it will create one.<\/span><\/del><\/p>\n<p><del><span style=\"text-decoration: underline;\">paste in the bellow lines and change your username and password to your needs. (same credentials to log on No-Ip site)<\/span><\/del><br \/>\n<del><span style=\"text-decoration: underline;\"> Type your DynDns adress\u00a0as\u00a0alias. ( for this tutorial we use\u00a0myairplane.no-ip.info\u00a0.<\/span><\/del><br \/>\n<del><span style=\"text-decoration: underline;\"> ina<\/span><\/del><br \/>\n<del><span style=\"text-decoration: underline;\"> If you are using dndns.org\u00a0dont change the dyndns_system. If you e.g using no-ip.info, change the<\/span><\/del><br \/>\n<del><span style=\"text-decoration: underline;\"> dyndns_system to default@no-ip.com<\/span><\/del><\/p>\n<p><del><span style=\"text-decoration: underline;\"><span class=\"pln\">username USERNAME<\/span><\/span><\/del><\/p>\n<p><del><span style=\"text-decoration: underline;\"><span class=\"pln\">password PASSWORD<\/span><\/span><\/del><\/p>\n<p><del><span style=\"text-decoration: underline;\"><span class=\"kwd\">alias<\/span><\/span><\/del><\/p>\n<p><del><span style=\"text-decoration: underline;\"><span class=\"pln\">dyndns_system dyndns@dyndns<\/span><span class=\"pun\">.<\/span><span class=\"pln\">org<\/span><\/span><\/del><\/p>\n<p><del><span style=\"text-decoration: underline;\"><span class=\"pln\">background<\/span><\/span><\/del><\/p>\n<p><del><span style=\"text-decoration: underline;\"><span class=\"pln\">update_period_sec <\/span><span class=\"lit\">60<\/span><span class=\"pln\"><br \/>\n<\/span><\/span><\/del><\/p>\n<p><del><span style=\"text-decoration: underline;\">Then we need to add this to startup script, so we dont need to start inadyn manually.<\/span><\/del><\/p>\n<p><del><span style=\"text-decoration: underline;\">Type this syntax, just before the exit 0.<\/span><\/del><\/p>\n<p><del><span style=\"text-decoration: underline;\">vi \/etc\/rc.local<\/span><\/del><\/p>\n<ol class=\"linenums\">\n<li class=\"L0\"><del><span style=\"text-decoration: underline;\"><span class=\"pln\">add <\/span><span class=\"kwd\">this<\/span><span class=\"pln\"> line<\/span><\/span><\/del><\/li>\n<\/ol>\n<ol class=\"linenums\">\n<li class=\"L0\"><del><span style=\"text-decoration: underline;\"><span class=\"str\">\/usr\/<\/span><span class=\"pln\">sbin<\/span><span class=\"pun\">\/<\/span><span class=\"pln\">inadyn <\/span><span class=\"pun\">&amp;<\/span><\/span><\/del><\/li>\n<\/ol>\n<p><del><span style=\"text-decoration: underline;\">Reboot Rpi.<\/span><\/del><\/p>\n<p>&nbsp;<\/p>\n<p>Vietoj dinaminio DNS naudosime kolegos <a href=\"mailto:goga@su.lt\">Goga<\/a> sukurt\u0105 skript\u0105, kurio funkcija periodi\u0161kai (kas 5min.) \u012f VJserver DB \u012fra\u0161ys IP adres\u0105, kur\u012f turi j\u0117gain\u0117s kontroleris. Kod\u0117l to reikia? ogi j\u0117gain\u0117s kontroleris per USB 3G modem\u0105 gauna inet\u0105 su kintamu IP adresu. Skriptas u\u017era\u0161ytas faile \/etc\/host2mysql faile. Jo esm\u0117 yra ifconfig komanda nuskaityti valdiklio IP adres\u0105 ir j\u012f kartu su host identifikatoriumi, kuris \u0161iuo atveju yra &#8216;vejas001&#8217;\u00a0 \u012fra\u0161yti \u012f nutolusi\u0105 (\u0161iuo atveju &#8216;defas.lt&#8217;) DB (\u0161iuo atveju &#8216;VJserver&#8217;). Jo turinys:<br \/>\n#!\/bin\/bash<br \/>\nsudo ifconfig ppp0 |grep &#8222;inet&#8221; | awk -F &#8222;:&#8221; &#8216;{print $2}&#8217;| awk &#8216;{print &#8222;insert into hosts(host,IP) values(\\x27vejas001\\x27,\\x27&#8221; $1 &#8222;\\x27)&#8221; }&#8217; |mysql -h defas.lt -uvejas -p********* VJserver<\/p>\n<p>Periodi\u0161kai paleidin\u0117sime \u0161\u012f skript\u0105, tad \u012fra\u0161ome eilut\u0119 \u012f CRONTAB&#8217;\u0105.<\/p>\n<p>komanda<strong> crontab -e<\/strong>:<\/p>\n<p><strong>0,5,10,15,20,25,30,35,40,45,50,55 * * * * \/etc\/host2mysql &gt;\/dev\/log\/crontab.log 2&gt;&amp;1<\/strong><\/p>\n<p>\u010cia nurodyt\u0105 skript\u0105 paleid\u017eiame kas 5 min.<\/p>\n<p>VJserver DB lentel\u0117s hosts strukt\u016bra (nutolusiame serveryje):<\/p>\n<p>DROP TABLE IF EXISTS `VJserver`.`hosts`;<br \/>\nCREATE TABLE\u00a0 `VJserver`.`hosts` (<br \/>\n`id` int(10) unsigned NOT NULL AUTO_INCREMENT,<br \/>\n`host` varchar(45) NOT NULL,<br \/>\n`IP` varchar(15) NOT NULL,<br \/>\n`ModDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,<br \/>\nPRIMARY KEY (`id`)<br \/>\n) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=latin1;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bernt Cristian Egeland komentaras http:\/\/uavmatrix.com\/viewpost\/2\/62\/116\/0\/PX4-PixHawk\/Setting-Up-Raspberry-Pi-A+-and-USB-3G-Modem%C2%A0 netinka, kadangi no-ip.com abonentas nemokamas tik pirm\u0105 m\u0117nes\u012f, be to nurodyta konfig\u016bracija neveikia o google nurodo \u012f nekorekti\u0161k\u0105 inadtn client debian paket\u0105. Taigi inadyn pakeyas i\u0161instaliuojamas. apt-get remove inadyn. Next we will install DynDns software which allows us to use a dynamic name to connect our laptop to RPI when &hellip; <a href=\"http:\/\/vejas.defas.lt\/?p=137\" class=\"more-link\">Skaityti toliau: <span class=\"screen-reader-text\">Dinaminio DNS registravimas<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-137","post","type-post","status-publish","format-standard","hentry","category-be-kategorijos"],"acf":[],"_links":{"self":[{"href":"http:\/\/vejas.defas.lt\/index.php?rest_route=\/wp\/v2\/posts\/137","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/vejas.defas.lt\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/vejas.defas.lt\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/vejas.defas.lt\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/vejas.defas.lt\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=137"}],"version-history":[{"count":6,"href":"http:\/\/vejas.defas.lt\/index.php?rest_route=\/wp\/v2\/posts\/137\/revisions"}],"predecessor-version":[{"id":147,"href":"http:\/\/vejas.defas.lt\/index.php?rest_route=\/wp\/v2\/posts\/137\/revisions\/147"}],"wp:attachment":[{"href":"http:\/\/vejas.defas.lt\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=137"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/vejas.defas.lt\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=137"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/vejas.defas.lt\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}