linux:ubuntu:network_setting

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
linux:ubuntu:network_setting [2014/11/28 10:06] – [Ubuntuのネットワーク設定] ともやんlinux:ubuntu:network_setting [2019/05/18 02:23] (現在) – 外部編集 非ログインユーザー
行 3: 行 3:
 $ sudo vi /etc/network/interfaces $ sudo vi /etc/network/interfaces
 </code> </code>
-<code ausoconf>+ 
 +DHCPの場合 
 +<code autoconf> 
 +auto lo 
 +iface lo inet loopback 
 + 
 +auto eth0 
 +iface eth0 inet dhcp 
 +</code> 
 + 
 +固定IPの場合 
 +<code autoconf>
 auto lo auto lo
 iface lo inet loopback iface lo inet loopback
行 18: 行 29:
 設定反映。 設定反映。
 <code> <code>
-$ sudo /etc/init.d/networking restart+$ sudo ifdown eth0 && sudo ifup eth0
 </code> </code>
  
行 37: 行 48:
     address 192.168.2.1     address 192.168.2.1
     netmask 255.255.255.0     netmask 255.255.255.0
 +</code>
 +
 +===== 複数NICの設定 =====
 +<code>
 +auto lo
 +iface lo inet loopback
 +
 +auto eth0
 +iface eth0 inet static
 +    address 192.168.1.1
 +    netmask 255.255.255.0
 +    gateway 192.168.1.254
 +    dns-nameservers 192.168.1.254
 +
 +auto eth1
 +iface eth1 inet static
 +    address 192.168.2.1
 +    netmask 255.255.255.0
 +    post-up /sbin/ip route del default dev eth1
 </code> </code>
 ====== トラブルシューティング ====== ====== トラブルシューティング ======
  • linux/ubuntu/network_setting.1417136798.txt.gz
  • 最終更新: 2019/05/18 02:23
  • (外部編集)