Archlinux set a static ip

1. Check the network card name

$ ifconfig

2. Copy the example configuration file.

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

3. Edit Profile

Vim # / etc / NETCTL / xxxxxx 

########################################## ######## 
the description = ' a static Basic Ethernet Connection ' // profile 
Interface = his name on the card to change xxxxxxxx // 
Connection = Ethernet 
the IP = static 
the Address = ( ' 192.168.1.20/24 ' ) / / fill in your own ip address 
#Routes = ( ' 192.168.0.0/24 Via 192.168.1.2 ' ) 
Gateway = ' 192.168.1.1 ' 
the 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. Start profile

# netctl enable xxxxxx

5. restart.

 

Guess you like

Origin www.cnblogs.com/mc-r/p/11588182.html