Linux基礎配置

2021-10-03 08:02:30 字數 1029 閱讀 5532

一、準備工具

vmware有三種網路連線模式:僅主機模式 nat模式 橋接模式(這裡主要講述nat模式)

1.設定靜態ip(nat模式)

編輯虛擬網路介面卡

修改虛擬機器配置

#vi /etc/sysconfig/network-scripts/ifcfg-eno***(有可能不同)

修改static

#這裡將dhcp換成static

onboot=yes #將no換成yes

新增配置檔案

ipaddr=192.168.200.130#靜態ip,和主機配置在同乙個網段

gateway=192.168.200.2 #預設閘道器netmask=255.255.255.0 #子網掩碼dns1=8.8.8.8/114.114.114.114

儲存退出後,重啟網路服務: service network restart(systemctl restart network)

注:主機與虛擬機器互ping時要留意關閉防火牆

關閉防火牆的命令

1、使用chkconfig命令,永久性生效

關閉防火牆:chkconfig iptables off

開啟防火牆:chkconfig iptables on

2、使用service命令;即時生效,重啟後失效

關閉防火牆:service iptables stop

開啟防火牆:service iptables start

安裝ifconfig(也可使用命令ip a查詢ip)

#yum install net-tools##

埠號netstat -intp

常用埠號:http、nginx、apache 都是8080

linux基礎配置

vim vimrc然後shift i進入插入模式新增下列 set nocompatible set nummber filetype on set history 1000 set background dark syntax on set autoindent set smartindent se...

Linux網路基礎配置

在linux centos 中,乙太網介面被命名為eth0,eth1,0,1表示網絡卡編號 通過 lspci檢視網絡卡硬體資訊 ifconfig檢視介面資訊 ifconfig a 檢視所有介面 ifconfig eth0 檢視指定介面資訊 ifup eth0 啟用介面 ifdown eth0 禁用乙...

linux網路配置基礎

linux網路配置基礎 2001 04 18 14 16 41 設定主機名和網域名稱 一 修改檔案 etc hostname 檔案包含系統的主機名稱 例如 www.com 二 修改檔案 etc sysconfig network 例如 networking yes hostname www.com ...