linux中控制网络的文件,Linux 网络管理(1) - 网络配置文件

实例[vagrant@10 ~]$ ifconfig

eth0: flags=4163 mtu 1500

inet 10.0.2.15 netmask 255.255.255.0 broadcast 10.0.2.255

inet6 fe80::e096:3a76:6df1:bd6d prefixlen 64 scopeid 0x20

ether 08:00:27:6b:57:88 txqueuelen 1000 (Ethernet)

RX packets 952 bytes 85854 (83.8 KiB)

RX errors 0 dropped 0 overruns 0 frame 0

TX packets 621 bytes 73814 (72.0 KiB)

TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eth1: flags=4163 mtu 1500

inet 192.168.33.88 netmask 255.255.255.0 broadcast 192.168.33.255

inet6 fe80::a00:27ff:fedb:788f prefixlen 64 scopeid 0x20

ether 08:00:27:db:78:8f txqueuelen 1000 (Ethernet)

RX packets 62 bytes 4389 (4.2 KiB)

RX errors 0 dropped 0 overruns 0 frame 0

TX packets 18 bytes 2208 (2.1 KiB)

TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73 mtu 65536

inet 127.0.0.1 netmask 255.0.0.0

inet6 ::1 prefixlen 128 scopeid 0x10

loop txqueuelen 0 (Local Loopback)

RX packets 0 bytes 0 (0.0 B)

RX errors 0 dropped 0 overruns 0 frame 0

TX packets 0 bytes 0 (0.0 B)

TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

[vagrant@10 ~]$ ll /etc/sysconfig/network-scripts/ifcfg-*

-rw-r--r-- 1 root root 168 Jul 14 2015 /etc/sysconfig/network-scripts/ifcfg-enp0s3

-rw-rw-r-- 1 vagrant vagrant 214 May 14 10:52 /etc/sysconfig/network-scripts/ifcfg-eth1

-rw-r--r-- 1 root root 254 Jan 2 16:29 /etc/sysconfig/network-scripts/ifcfg-lo

[vagrant@10 ~]$ cat /etc/sysconfig/network-scripts/ifcfg-lo

DEVICE=lo

IPADDR=127.0.0.1

NETMASK=255.0.0.0

NETWORK=127.0.0.0

# If you're having problems with gated making 127.0.0.0/8 a martian,

# you can change this to something else (255.255.255.255, for example)

BROADCAST=127.255.255.255

ONBOOT=yes

NAME=loopback

[vagrant@10 ~]$ cat /etc/sysconfig/network-scripts/ifcfg-eth1

#VAGRANT-BEGIN

# The contents below are automatically generated by Vagrant. Do not modify.

NM_CONTROLLED=yes

BOOTPROTO=none

ONBOOT=yes

IPADDR=192.168.33.88

NETMASK=255.255.255.0

DEVICE=eth1

PEERDNS=no

#VAGRANT-END

[vagrant@10 ~]$ cat /etc/sysconfig/network-scripts/ifcfg-enp0s3

# Generated by dracut initrd

NAME="enp0s3"

DEVICE="enp0s3"

ONBOOT=yes

NETBOOT=yes

UUID="8924a5b0-f9f4-453b-910d-118a91dac1ec"

IPV6INIT=yes

BOOTPROTO=dhcp

TYPE=Ethernet

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值