Skip to content

Latest commit

 

History

History
32 lines (20 loc) · 629 Bytes

ubuntu-network-settings.rst

File metadata and controls

32 lines (20 loc) · 629 Bytes
  • 察看 routing table

    $ route
    
  • 一次設定 IP

    $ sudo ifconfig eth4 xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx
    
  • 新增 default route

    $ sudo ip route add default via <gateway IP>
    $ sudo route add default gw <gateway IP>
    
  • 永久設定 IP

    #/etc/network/interfaces
    #auto lo
    #iface lo inet loopback
    
    auto eth4
    
    #iface eth0 inet static
    iface eth4 inet static
    #address xxx.xxx.xxx.xxx
    address xxx.xxx.xxx.xxx
    netmask xxx.xxx.xxx.xxx
    gateway xxx.xxx.xxx.xxx
    
  • 重啟網路

    $ sudo /etc/init.d/networking restart