[Ubuntu] 單網卡綁多IP

auto lo
iface lo inet loopback
iface enp0s25 inet static
address 192.168.1.168
netmask 255.255.255.0
gateway 192.168.1.254
# 新增第二筆網卡設定auto enp0s25:0 inet static
address 192.168.1.169
netmask 255.255.255.0
gateway 192.168.1.254
$sudo /etc/init.d/networking restart 
$ ip -4 a
$sudo ifconfig enp0s25:0 192.168.1.168 broadcast 110.25.*.255 netmask 255.255.255.0
enp0s25   Link encap:Ethernet  HWaddr d8:9e:f3:07:1c:c8
inet addr:192.168.1.168 Bcast:192.168.1.254 Mask:255.255.255.0
inet6 addr: fe80::664b:1637:57:1988/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7118762 errors:0 dropped:3335 overruns:0 frame:0
TX packets:475033 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1173901654 (1.1 GB) TX bytes:46806446 (46.8 MB)
Interrupt:20 Memory:f7100000-f7120000
enp0s25:0 Link encap:Ethernet HWaddr d8:9e:f3:07:1c:c8
inet addr:192.168.1.169 Bcast:192.168.1.254 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:20 Memory:f7100000-f7120000

--

--

--

工程師斜槓山岳攝影師,

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Frank Lin

Frank Lin

工程師斜槓山岳攝影師,

More from Medium

Time is Money: Five Easy Ways to Optimize Your SQL Queries

servers with dollar sign

Did you know that there are cables underneath the ocean?

Thank you for being a Friend

Whatever happens in Hungary on Sunday…