Archlinux设置静态ip

1. 查看网卡名称

$ ifconfig

2. 复制配置文件例子。

# cp /etc/netctl/examples/ xxxxx  ../xxxxx

3. 编辑配置文件

# vim /etc/netctl/xxxxxx

##################################################
Description='A basic static ethernet connection'  //描述文件
Interface=xxxxxxxx   //改上自己的网卡名称
Connection=ethernet
IP=static
Address=('192.168.1.20/24')    //填写自己的ip地址
#Routes=('192.168.0.0/24 via 192.168.1.2')
Gateway='192.168.1.1'
DNS=('192.168.1.1')

## For IPv6 autoconfiguration
#IP6=stateless

## For IPv6 static address configuration
#IP6=static
#Address6=('1234:5678:9abc:def::1/64' '1234:3456::123/96')
#Routes6=('abcd::1234')
#Gateway6='1234:0:123::abcd'

4. 启动配置文件

# netctl enable xxxxxx

5. 重启即可。

 

转载于:https://www.cnblogs.com/mc-r/p/11588182.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值