Ubuntu局域网设置静态IP
通过修改NetManager中的连接信息实现静态IP的设置(也可以通过桌面设置)
步骤
- 打开NetManager中的system-connections
cd /etc/NetworkManager/system-connections
- 修改连接信息
sudo vim TP-LINK_2C40
配置信息如下
id=TP-LINK_2C40
uuid=xxxx
type=wifi
permissions=
secondaries=
timestamp=1516818041
[wifi]
mac-address=xxxx
mac-address-blacklist=
mac-address-randomization=0
mode=infrastructure
seen-bssids=FC:D7:33:42:2C:40;
ssid=TP-LINK_2C40
[wifi-security]
group=
key-mgmt=wpa-psk
pairwise=
proto=
psk=LIU15016032332wang
[ipv4]
dns-search=
method=auto
[ipv6]
addr-gen-mode=stable-privacy
dns-search=
ip6-privacy=0
修改后如下
id=TP-LINK_2C40
uuid=xxxx
type=wifi
permissions=
secondaries=
timestamp=1516818041
[wifi]
mac-address=xxxx
mac-address-blacklist=
mac-address-randomization=0
mode=infrastructure
seen-bssids=FC:D7:33:42:2C:40;
ssid=TP-LINK_2C40
[wifi-security]
group=
key-mgmt=wpa-psk
pairwise=
proto=
psk=LIU15016032332wang
[ipv4]
address1=192.168.1.1/24,192.168.1.1 #设置静态IP地址
dns-search=
method=manual #设置为手动模式
[ipv6]
addr-gen-mode=stable-privacy
dns-search=
ip6-privacy=0
- 重启
sudo reboot now
重启后静态IP设置成功