LoginSignup
0
1

More than 5 years have passed since last update.

ネットワーク設定メモ

Posted at

はじめに

特殊なデバイス
でブート時にネットワーク有効化するのにはまったのでメモ。

最終的には以下のような環境を構築したかった

ria@localhost:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr f0:ad:4e:XX:XX:XX  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:72 errors:0 dropped:0 overruns:0 frame:0
          TX packets:55 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:532 
          RX bytes:7562 (7.5 KB)  TX bytes:7731 (7.7 KB)
          Interrupt:9 

lan0      Link encap:Ethernet  HWaddr f0:ad:4e:XX:XX:XX  
          inet addr:192.168.1.212  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:72 errors:0 dropped:0 overruns:0 frame:0
          TX packets:55 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:5978 (5.9 KB)  TX bytes:7291 (7.2 KB)

構成

eth0に、lan0, lan1, wanの3つがぶら下がっており、eth0を立ち上げてからでないとlan0以下のポートがup出来ない環境となっていた。

失敗例

・ lan0だけ立ち上げてみる

#iface lan0 inet dhcp
iface lan0 inet static
address 192.168.1.212
network 192.168.1.0
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 8.8.8.8
auto lan0

eth0が立ち上がってないのでネットワーク起動エラー。

・eth0も立ち上げてみる

iface eth0 inet manual
auto eth0

#iface lan0 inet dhcp
iface lan0 inet static
address 192.168.1.212
network 192.168.1.0
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 8.8.8.8
auto lan0

eth0とlan0が同時に立ち上がるらしくこれまたネットワーク起動エラー。

暫定解決策

起動順番を指定するオプション替わりとして、以下のように対処。

iface eth0 inet manual
post-up ifconfig lan0 up
auto eth0

#iface lan0 inet dhcp
iface lan0 inet static
address 192.168.1.212
network 192.168.1.0
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 8.8.8.8
auto lan0

ようやくブート時にネットワーク有効化できるようになった。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1