---
title: "Linux学习笔记（八）网络命令"
author: "pluto418"
date: "2013-09-01T15:54:59Z"
tags: []
categories: ["企业架构"]
slug: "linux"
draft: false
lastmod: "2013-09-01T15:48:42Z"
id: 1934983
url: "https://pluto418.iteye.com/blog/1934983"
---

1. 命令: ifconfig 检查活动网络适配器
$ ifconfig -a     检查活动网络适配器 

$ ifconfig eth0 down  停用网络适配器
$ ifconfig eth0 up 启用网络适配器

为网络适配器eth0设定IP地址“192.168.1.12”.
$ ifconfig eth0 192.168.1.12
更改网络适配器eth0的子网掩码
$ ifconfig eth0 netmask 255.255.255.
更改网络适配器eth0的广播地址
$ ifconfig eth0 broadcast 192.168.1.255
为网络适配器eth0指定IP地址,子网掩码，广播地址 
$ ifconfig eth0 192.168.1.12 netmask 255.255.255.0 broadcast 192.168.1.255

2.命令: netstat 显示各种网络相关的信息
$ netstat -a    列出所有的网络端口
$ netstat -at  显示所有tcp相关端口
$ netstat -s  显示所有连接的统计信息