{"id":1024,"date":"2016-04-18T11:33:16","date_gmt":"2016-04-18T16:33:16","guid":{"rendered":"http:\/\/gruson.name\/weblog\/?p=1024"},"modified":"2016-04-22T10:26:39","modified_gmt":"2016-04-22T15:26:39","slug":"open-bsd-configuration-de-linterface-reseau","status":"publish","type":"post","link":"http:\/\/gruson.name\/weblog\/2016\/04\/18\/open-bsd-configuration-de-linterface-reseau\/","title":{"rendered":"Open BSD configuration de l&#8217;interface r\u00e9seau"},"content":{"rendered":"<h2>Un serveur, c&#8217;est mieux avec une adresse IP fixe&#8230;<\/h2>\n<p>Toujours sur mon openbsd, je l&#8217;int\u00e8gre dans un r\u00e9seau avec une ip fixe.<\/p>\n<p>Mais comment faire ?<\/p>\n<p>Finalement c&#8217;est assez simple. Une fois install\u00e9 votre \u00e9diteur de texte favori via un<\/p>\n<pre><span style=\"color: #99cc00;\">$ pkg_add vim<\/span><\/pre>\n<p>et il vous propose plusieurs versions (comme je suis en connexion \u00e0 distance j&#8217;ai pris vim sans x11).<\/p>\n<h2>Modifier mon fichier d&#8217;interface<\/h2>\n<p>Puis je passe en root et modifie mon fichier pour l&#8217;interface qui est simplissime.<\/p>\n<pre><span style=\"color: #99cc00;\">$ su root<\/span>\r\n<span style=\"color: #99cc00;\"># <code>vim \/etc\/hostname.re0<\/code><\/span><\/pre>\n<p>Comment re0 ?<br \/>\nLa commande ifconfig donne la liste de toutes les interfaces et celle qui contient votre adresse IP est l&#8217;interface utilis\u00e9e par l&#8217;ordinateur.<\/p>\n<pre><span style=\"color: #99cc00;\">$ ifconfig\r\n\r\nlo0: flags=8049&lt;UP,LOOPBACK,RUNNING,MULTICAST&gt; mtu 32768<\/span>\r\n<span style=\"color: #99cc00;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 priority: 0<\/span>\r\n<span style=\"color: #99cc00;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 groups: lo<\/span>\r\n<span style=\"color: #99cc00;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 inet6 ::1 prefixlen 128<\/span>\r\n<span style=\"color: #99cc00;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3<\/span>\r\n<span style=\"color: #99cc00;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 inet 127.0.0.1 netmask 0xff000000<\/span>\r\n<span style=\"color: #99cc00;\"><span style=\"text-decoration: underline; color: #339966;\"><strong>re0<\/strong><\/span>: flags=18843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,MPSAFE&gt; mtu 1500<\/span>\r\n<span style=\"color: #99cc00;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 lladdr 00:1f:d0:a1:b6:99<\/span>\r\n<span style=\"color: #99cc00;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 priority: 0<\/span>\r\n<span style=\"color: #99cc00;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 groups: egress<\/span>\r\n<span style=\"color: #99cc00;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 media: Ethernet autoselect (1000baseT full-duplex,rxpause,txpause)<\/span>\r\n<span style=\"color: #99cc00;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 status: active<\/span>\r\n<span style=\"color: #99cc00;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 inet <span style=\"text-decoration: underline; color: #339966;\"><strong>192.168.92.224<\/strong><\/span> netmask 0xffffff00 broadcast 192.168.92.255<\/span>\r\n<span style=\"color: #99cc00;\">enc0: flags=0&lt;&gt;<\/span>\r\n<span style=\"color: #99cc00;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 priority: 0<\/span>\r\n<span style=\"color: #99cc00;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 groups: enc<\/span>\r\n<span style=\"color: #99cc00;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 status: active<\/span>\r\n<span style=\"color: #99cc00;\">pflog0: flags=141&lt;UP,RUNNING,PROMISC&gt; mtu 33144<\/span>\r\n<span style=\"color: #99cc00;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 priority: 0<\/span>\r\n<span style=\"color: #99cc00;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 groups: pflog<\/span><\/pre>\n<p>Le fichier est simple, tellement que je me suis demand\u00e9 si je ne m&#8217;\u00e9tais pas tromp\u00e9 :<\/p>\n<pre><span style=\"color: #99cc00;\">dhcp<\/span><\/pre>\n<p>J&#8217;efface donc ce simple terme et le remplace\u00a0 par<\/p>\n<pre><span style=\"color: #99cc00;\">inet 192.168.92.224 255.255.255.0 NONE # votre adresse IP fixe suivi du masque de sous-r\u00e9seau\r\n!route add default 192.168.92.1 #l'adresse du routeur<\/span><\/pre>\n<p>Enfin un truc de barbu :-)<\/p>\n<p>On red\u00e9marre, non pas le serveur mais juste l&#8217;interface r\u00e9seau via<\/p>\n<pre><span style=\"color: #99cc00;\"># sh \/etc\/netstart<\/span><\/pre>\n<p>et <span style=\"color: #99cc00;\">ifconfig<\/span> confirme le changement d&#8217;adresse IP, et ma session ssh n&#8217;a m\u00eame pas quitt\u00e9. Si c&#8217;est pas beau \\o\/ .<\/p>\n<p>(presque il vaut mieux red\u00e9marrer quand m\u00eame&#8230;).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Un serveur, c&#8217;est mieux avec une adresse IP fixe&#8230; Toujours sur mon openbsd, je l&#8217;int\u00e8gre dans un r\u00e9seau avec une ip fixe. Mais comment faire ? Finalement c&#8217;est assez simple. Une fois install\u00e9 votre \u00e9diteur de texte favori via un $ pkg_add vim et il vous propose plusieurs versions (comme je suis en connexion \u00e0 &hellip; <a href=\"http:\/\/gruson.name\/weblog\/2016\/04\/18\/open-bsd-configuration-de-linterface-reseau\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Open BSD configuration de l&#8217;interface r\u00e9seau<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58],"tags":[],"class_list":["post-1024","post","type-post","status-publish","format-standard","hentry","category-openbsd"],"_links":{"self":[{"href":"http:\/\/gruson.name\/weblog\/wp-json\/wp\/v2\/posts\/1024","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/gruson.name\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/gruson.name\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/gruson.name\/weblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/gruson.name\/weblog\/wp-json\/wp\/v2\/comments?post=1024"}],"version-history":[{"count":7,"href":"http:\/\/gruson.name\/weblog\/wp-json\/wp\/v2\/posts\/1024\/revisions"}],"predecessor-version":[{"id":1031,"href":"http:\/\/gruson.name\/weblog\/wp-json\/wp\/v2\/posts\/1024\/revisions\/1031"}],"wp:attachment":[{"href":"http:\/\/gruson.name\/weblog\/wp-json\/wp\/v2\/media?parent=1024"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/gruson.name\/weblog\/wp-json\/wp\/v2\/categories?post=1024"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/gruson.name\/weblog\/wp-json\/wp\/v2\/tags?post=1024"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}