我不知道为什么没有 /etc/network/interfaces 文件但我仍然可以访问互联网:显示如下:
osboxes@osboxes:~$ cd /etc/network/
osboxes@osboxes:/etc/network$ ls
if-down.d if-post-down.d if-pre-up.d if-up.d
下面是我的 ifconfig 显示:
osboxes@osboxes:~$ ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.109.132 netmask 255.255.255.0 broadcast 192.168.109.255
inet6 fe80::4b56:f1d8:ad1a:51b0 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:fe:5f:fa txqueuelen 1000 (Ethernet)
RX packets 178 bytes 62290 (62.2 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 181 bytes 28488 (28.4 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 19 base 0x2000
ens34: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.123.48 netmask 255.255.255.0 broadcast 192.168.123.255
inet6 fe80::4cc0:a44a:116c:acdf prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:fe:5f:04 txqueuelen 1000 (Ethernet)
RX packets 50 bytes 7803 (7.8 KB)
RX errors 0 dropped 1 overruns 0 frame 0
TX packets 75 bytes 9760 (9.7 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 16 base 0x2080
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 216 bytes 18223 (18.2 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 216 bytes 18223 (18.2 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
第一个是 NAT 模式,第二个是从我的本地网络桥接的;我想使用 ens34 接口添加静态路由,所以我应该在哪里添加静态路由,有人可以告诉我,非常感谢!!!