Ubuntu內網、外網網絡IP地址配置


首先切換到root用戶:sudo su 

修改網絡配置文件:vi  /etc/network/interfaces

---配置一個ip靜態ip地址,配置如下:
auto lo
iface lo inet loopback
auto eth0
iface eth inet static
address 192.168.1.11
netmask 255.255.255.0
gateway 192.168.1.1

如果eth0是自動獲取IP,那么配置如下

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp
---配置兩個網絡
auto eth0
iface eth0 inet static
address 192.168.0.13
netmask 255.255.225.0
auto eth1
iface eth1 inet static
address 192.168.1.22
netmask 255.255.225.0
gateway 192.168.1.1


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM