使用pppoe後,虛擬IP就沒了 [論壇 - 新手村]


正在瀏覽:   1 名遊客


 到底部   前一個主題   下一個主題  [無發表權] 請登錄或者註冊

« 1 (2)


回覆: 使用pppoe後,虛擬IP就沒了
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 36
HP : 177 / 889
MP : 647 / 27531
EXP: 56
離線
================================================================================

[回到索引]

================================================================================

# 簡易探索 Package: ifupdown

================================================================================

在上一個回覆「#10」,發現有「Package: ifupdown」和「Package: ifupdown-ng

這裡紀錄探索「ifupdown」。

================================================================================

我的系統,預設沒有安裝「ifupdown」,目前暫時還沒有要安裝

除了可以觀看網頁,了解到有那些檔案

也可以下載「Debian Package」下來,解開來觀看。

================================================================================

執行


apt-get download ifupdown



會下載一個檔案「ifupdown_0.8.36+nmu1ubuntu3_amd64.deb」

================================================================================

執行下面指令,解開「ifupdown_0.8.36+nmu1ubuntu3_amd64.deb」


dpkg -x ifupdown_0.8.36+nmu1ubuntu3_amd64.deb ifupdown



會解開到「ifupdown」這個資料夾

================================================================================

執行下面指令,觀看「ifupdown」這個資料夾的檔案結構。


tree ifupdown



顯示


ifupdown
├── etc
│   ├── default
│   │   └── networking
│   ├── init.d
│   │   └── networking
│   └── network
│       ├── if-down.d
│       │   └── resolved
│       ├── if-post-down.d
│       ├── if-pre-up.d
│       ├── if-up.d
│       │   └── resolved
│       └── interfaces.d
├── lib
│   ├── ifupdown
│   │   ├── settle-dad.sh
│   │   ├── wait-for-ll6.sh
│   │   └── wait-online.sh
│   ├── systemd
│   │   └── system
│   │       ├── ifupdown-pre.service
│   │       ├── ifupdown-wait-online.service
│   │       ├── ifup@.service
│   │       └── networking.service
│   └── udev
│       ├── ifupdown-hotplug
│       └── rules.d
│           └── 80-ifupdown.rules
├── sbin
│   ├── ifdown -> ifup
│   ├── ifquery -> ifup
│   └── ifup
└── usr
    └── share
        ├── bug
        │   └── ifupdown
        ├── doc
        │   └── ifupdown
        │       ├── changelog.gz
        │       ├── contrib
        │       │   ├── ensureifup
        │       │   ├── ifstate
        │       │   └── ifstate-check
        │       ├── copyright
        │       ├── examples
        │       │   ├── bridge
        │       │   ├── check-mac-address.sh
        │       │   ├── generate-interfaces.pl
        │       │   ├── get-mac-address.sh
        │       │   ├── network-interfaces
        │       │   ├── pattern-matching
        │       │   ├── pcmcia-compat.sh
        │       │   └── ping-places.sh
        │       └── NEWS.Debian.gz
        ├── lintian
        │   └── overrides
        │       └── ifupdown
        └── man
            ├── man5
            │   └── interfaces.5.gz
            └── man8
                ├── ifdown.8.gz -> ifup.8.gz
                ├── ifquery.8.gz -> ifup.8.gz
                └── ifup.8.gz

28 directories, 36 files



================================================================================

執行


ls -1 ifupdown/lib/systemd/system/*



顯示



ifupdown/lib/systemd/system/ifupdown-pre.service
ifupdown/lib/systemd/system/ifupdown-wait-online.service
ifupdown/lib/systemd/system/ifup@.service
ifupdown/lib/systemd/system/networking.service



* #17, #20 - 回覆: 請問 Ubuntu Server 22.04 啟動程序

================================================================================

執行


file $(ls -1 ifupdown/sbin/*)



顯示


ifupdown/sbin/ifdown: symbolic link to ifup
ifupdown/sbin/ifquery: symbolic link to ifup
ifupdown/sbin/ifup: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=89efa6d78270ea133c96f7f0daaf347c387beebb, for GNU/Linux 3.2.0, stripped



================================================================================

* man ./ifupdown/usr/share/man/man5/interfaces.5.gz
* man ./ifupdown/usr/share/man/man8/ifup.8.gz
* man ./ifupdown/usr/share/man/man8/ifdown.8.gz
* man ./ifupdown/usr/share/man/man8/ifquery.8.gz

================================================================================

* Package: ifupdown / filelist
* Source Package: ifupdown

================================================================================

[回到索引]

================================================================================

待續...

8/2 23:51:25
應用擴展 工具箱
回覆: 使用pppoe後,虛擬IP就沒了
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 36
HP : 177 / 889
MP : 647 / 27531
EXP: 56
離線
================================================================================

[回到索引]

================================================================================

# 簡易探索 Source Package: ifupdown

================================================================================

執行下面指令,下載「Source Package: ifupdown


apt-get source ifupdown



會下載下面兩個檔案

* ifupdown_0.8.36+nmu1ubuntu3.dsc
* ifupdown_0.8.36+nmu1ubuntu3.tar.xz

並且解開到「ifupdown-0.8.36+nmu1ubuntu3」這個資料夾

================================================================================

執行


grep '/etc/network/interfaces' ./ifupdown-0.8.36+nmu1ubuntu3/*.c -R



顯示


./ifupdown-0.8.36+nmu1ubuntu3/main.c:		"\t                       /etc/network/interfaces\n"
./ifupdown-0.8.36+nmu1ubuntu3/main.c:		interfaces = strdup("/etc/network/interfaces");



================================================================================

[回到索引]

================================================================================

待續...

8/2 23:55:21
應用擴展 工具箱
回覆: 使用pppoe後,虛擬IP就沒了
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 36
HP : 177 / 889
MP : 647 / 27531
EXP: 56
離線
================================================================================

[回到索引]

================================================================================

# 簡易探索 Package: network-manager

================================================================================

在我的系統,預設有安裝「Package: network-manager

================================================================================

執行下面指令,觀看「Package: network-manager / filelist


dpkg -L network-manager | sort



顯示


/.
/etc
/etc/NetworkManager
/etc/NetworkManager/conf.d
/etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
/etc/NetworkManager/dispatcher.d
/etc/NetworkManager/dispatcher.d/01-ifupdown
/etc/NetworkManager/dispatcher.d/no-wait.d
/etc/NetworkManager/dispatcher.d/pre-down.d
/etc/NetworkManager/dispatcher.d/pre-up.d
/etc/NetworkManager/dnsmasq.d
/etc/NetworkManager/dnsmasq-shared.d
/etc/NetworkManager/NetworkManager.conf
/etc/NetworkManager/system-connections
/lib
/lib/systemd
/lib/systemd/system
/lib/systemd/system/NetworkManager-dispatcher.service
/lib/systemd/system/NetworkManager.service
/lib/systemd/system/NetworkManager-wait-online.service
/lib/systemd/system/nm-priv-helper.service
/lib/udev
/lib/udev/rules.d
/lib/udev/rules.d/84-nm-drivers.rules
/lib/udev/rules.d/85-nm-unmanaged.rules
/lib/udev/rules.d/90-nm-thunderbolt.rules
/usr
/usr/bin
/usr/bin/nmcli
/usr/bin/nm-online
/usr/bin/nmtui
/usr/bin/nmtui-connect
/usr/bin/nmtui-edit
/usr/bin/nmtui-hostname
/usr/lib
/usr/lib/firewalld
/usr/lib/firewalld/zones
/usr/lib/firewalld/zones/nm-shared.xml
/usr/lib/NetworkManager
/usr/lib/NetworkManager/conf.d
/usr/lib/NetworkManager/conf.d/10-dns-resolved.conf
/usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf
/usr/lib/NetworkManager/dispatcher.d
/usr/lib/NetworkManager/dispatcher.d/no-wait.d
/usr/lib/NetworkManager/dispatcher.d/pre-down.d
/usr/lib/NetworkManager/dispatcher.d/pre-up.d
/usr/lib/NetworkManager/nm-daemon-helper
/usr/lib/NetworkManager/nm-dhcp-helper
/usr/lib/NetworkManager/nm-dispatcher
/usr/lib/NetworkManager/nm-initrd-generator
/usr/lib/NetworkManager/nm-priv-helper
/usr/lib/NetworkManager/system-connections
/usr/lib/NetworkManager/VPN
/usr/lib/pppd
/usr/lib/pppd/2.4.9
/usr/lib/pppd/2.4.9/nm-pppd-plugin.so
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/NetworkManager
/usr/lib/x86_64-linux-gnu/NetworkManager/1.36.6
/usr/lib/x86_64-linux-gnu/NetworkManager/1.36.6/libnm-device-plugin-adsl.so
/usr/lib/x86_64-linux-gnu/NetworkManager/1.36.6/libnm-device-plugin-bluetooth.so
/usr/lib/x86_64-linux-gnu/NetworkManager/1.36.6/libnm-device-plugin-team.so
/usr/lib/x86_64-linux-gnu/NetworkManager/1.36.6/libnm-device-plugin-wifi.so
/usr/lib/x86_64-linux-gnu/NetworkManager/1.36.6/libnm-device-plugin-wwan.so
/usr/lib/x86_64-linux-gnu/NetworkManager/1.36.6/libnm-ppp-plugin.so
[color=blue]/usr/lib/x86_64-linux-gnu/NetworkManager/1.36.6/libnm-settings-plugin-ifupdown.so

/usr/lib/x86_64-linux-gnu/NetworkManager/1.36.6/libnm-wwan.so
/usr/sbin
/usr/sbin/NetworkManager
/usr/share
/usr/share/apport
/usr/share/apport/package-hooks
/usr/share/apport/package-hooks/source_network-manager-applet.py
/usr/share/apport/package-hooks/source_network-manager.py
/usr/share/bash-completion
/usr/share/bash-completion/completions
/usr/share/bash-completion/completions/nmcli
/usr/share/bug
/usr/share/bug/network-manager
/usr/share/bug/network-manager/control
/usr/share/dbus-1
/usr/share/dbus-1/system.d
/usr/share/dbus-1/system.d/nm-dispatcher.conf
/usr/share/dbus-1/system.d/nm-priv-helper.conf
/usr/share/dbus-1/system.d/org.freedesktop.NetworkManager.conf
/usr/share/dbus-1/system-services
/usr/share/dbus-1/system-services/org.freedesktop.nm_dispatcher.service
/usr/share/dbus-1/system-services/org.freedesktop.nm_priv_helper.service
/usr/share/doc
/usr/share/doc/network-manager
/usr/share/doc/network-manager/AUTHORS
/usr/share/doc/network-manager/changelog.Debian.gz
/usr/share/doc/network-manager/copyright
/usr/share/doc/network-manager/examples
/usr/share/doc/network-manager/examples/server.conf
/usr/share/doc/network-manager/NEWS.gz
/usr/share/doc/network-manager/README.Debian
/usr/share/doc/network-manager/README.gz
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/network-manager
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/nmcli.1.gz
/usr/share/man/man1/nm-online.1.gz
/usr/share/man/man1/nmtui.1.gz
/usr/share/man/man1/nmtui-connect.1.gz
/usr/share/man/man1/nmtui-edit.1.gz
/usr/share/man/man1/nmtui-hostname.1.gz
/usr/share/man/man5
/usr/share/man/man5/NetworkManager.conf.5.gz
/usr/share/man/man5/nm-settings.5.gz
/usr/share/man/man5/nm-settings-dbus.5.gz
/usr/share/man/man5/nm-settings-keyfile.5.gz
/usr/share/man/man5/nm-settings-nmcli.5.gz
/usr/share/man/man5/nm-system-settings.conf.5.gz
/usr/share/man/man7
/usr/share/man/man7/nmcli-examples.7.gz
/usr/share/man/man8
/usr/share/man/man8/NetworkManager.8.gz
/usr/share/man/man8/NetworkManager-dispatcher.8.gz
/usr/share/man/man8/nm-initrd-generator.8.gz
/usr/share/polkit-1
/usr/share/polkit-1/actions
/usr/share/polkit-1/actions/org.freedesktop.NetworkManager.policy
/usr/share/polkit-1/rules.d
/usr/share/polkit-1/rules.d/org.freedesktop.NetworkManager.rules
/var
/var/lib
/var/lib/NetworkManager
/var/lib/polkit-1
/var/lib/polkit-1/localauthority
/var/lib/polkit-1/localauthority/10-vendor.d
/var/lib/polkit-1/localauthority/10-vendor.d/org.freedesktop.NetworkManager.pkla



================================================================================

執行


dpkg -L network-manager | grep 'systemd' | sort



顯示


/lib/systemd
/lib/systemd/system
/lib/systemd/system/NetworkManager-dispatcher.service
/lib/systemd/system/NetworkManager.service
/lib/systemd/system/NetworkManager-wait-online.service
/lib/systemd/system/nm-priv-helper.service



* #17, #20 - 回覆: 請問 Ubuntu Server 22.04 啟動程序

================================================================================

執行


dpkg -L network-manager | grep 'bin/' | sort



顯示


/usr/bin/nmcli
/usr/bin/nm-online
/usr/bin/nmtui
/usr/bin/nmtui-connect
/usr/bin/nmtui-edit
/usr/bin/nmtui-hostname
/usr/sbin/NetworkManager



執行


file $(dpkg -L network-manager | grep 'bin/' | sort)



顯示


/usr/bin/nmcli: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=def92d34cfd37f806ecb17bcf6e906ba1a0f0fb0, for GNU/Linux 3.2.0, stripped
/usr/bin/nm-online: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=d146df86eb09a558d4ea2144b283174a13abd638, for GNU/Linux 3.2.0, stripped
/usr/bin/nmtui: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=c50fbfa8b074810eaf73428a41adccdd893b5680, for GNU/Linux 3.2.0, stripped
/usr/bin/nmtui-connect: symbolic link to nmtui
/usr/bin/nmtui-edit: symbolic link to nmtui
/usr/bin/nmtui-hostname: symbolic link to nmtui
/usr/sbin/NetworkManager: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=5128fbf4f06801b8c75859f42904a2e97c9ddee5, for GNU/Linux 3.2.0, stripped



================================================================================

執行


dpkg -L network-manager | grep '/man/man.*/' | sort



顯示


/usr/share/man/man1/nmcli.1.gz
/usr/share/man/man1/nm-online.1.gz
/usr/share/man/man1/nmtui.1.gz
/usr/share/man/man1/nmtui-connect.1.gz
/usr/share/man/man1/nmtui-edit.1.gz
/usr/share/man/man1/nmtui-hostname.1.gz
/usr/share/man/man5/NetworkManager.conf.5.gz
/usr/share/man/man5/nm-settings.5.gz
/usr/share/man/man5/nm-settings-dbus.5.gz
/usr/share/man/man5/nm-settings-keyfile.5.gz
/usr/share/man/man5/nm-settings-nmcli.5.gz
/usr/share/man/man5/nm-system-settings.conf.5.gz
/usr/share/man/man7/nmcli-examples.7.gz
/usr/share/man/man8/NetworkManager.8.gz
/usr/share/man/man8/NetworkManager-dispatcher.8.gz
/usr/share/man/man8/nm-initrd-generator.8.gz




* man nmcli
* man nm-online
* man nmtui
* man nmtui-connect
* man nmtui-edit
* man nmtui-hostname
* man NetworkManager.conf
* man nm-settings
* man nm-settings-dbus
* man nm-settings-keyfile
* man nm-settings-nmcli
* man nm-system-settings.conf
* man nmcli-examples
* man NetworkManager
* man NetworkManager-dispatcher
* man nm-initrd-generator

================================================================================

執行


dpkg -L network-manager | grep '/etc'



顯示


/etc
/etc/NetworkManager
/etc/NetworkManager/NetworkManager.conf
/etc/NetworkManager/conf.d
/etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
/etc/NetworkManager/dispatcher.d
/etc/NetworkManager/dispatcher.d/01-ifupdown
/etc/NetworkManager/dispatcher.d/no-wait.d
/etc/NetworkManager/dispatcher.d/pre-down.d
/etc/NetworkManager/dispatcher.d/pre-up.d
/etc/NetworkManager/dnsmasq-shared.d
/etc/NetworkManager/dnsmasq.d
/etc/NetworkManager/system-connections



================================================================================

[回到索引]

================================================================================

待續...

8/3 0:00:25
應用擴展 工具箱
回覆: 使用pppoe後,虛擬IP就沒了
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 36
HP : 177 / 889
MP : 647 / 27531
EXP: 56
離線
================================================================================

[回到索引]

================================================================================

# 進一步探索 Package: network-manager

================================================================================

延續「#13

================================================================================

## /etc/NetworkManager/NetworkManager.conf

執行下面指令,觀看「/etc/NetworkManager/NetworkManager.conf」這個檔案的內容


cat /etc/NetworkManager/NetworkManager.conf



顯示


[main]
plugins=ifupdown,keyfile

[ifupdown]
managed=false

[device]
wifi.scan-rand-mac-address=no



================================================================================

關於


[main]
plugins=ifupdown,keyfile



可以閱讀「man NetworkManager.conf」,找到「MAIN SECTION」和「PLUGINS」這兩個章節來閱讀。

$ man NetworkManager.conf 寫到:

ifupdown
	This plugin is used on the Debian and Ubuntu distributions, and reads Ethernet and
	Wi-Fi connections from /etc/network/interfaces.

	This plugin is read-only; any connections (of any type) added from within
	NetworkManager when you are using this plugin will be saved using the keyfile plugin
	instead.



並且對照下面幾個回覆提到的

* #9 - 簡易探索 Package: pppoeconf
* #10 - 初步探索「/etc/network/interfaces」
* #11 - 簡易探索 Package: ifupdown

================================================================================

關於


[ifupdown]
managed=false



可以閱讀「man NetworkManager.conf」,找到「IFUPDOWN SECTION」這個章節來閱讀。

$ man NetworkManager.conf 寫到:

This section contains ifupdown-specific options and thus only has effect when using the
ifupdown plugin.

managed
	If set to true, then interfaces listed in /etc/network/interfaces are managed by
	NetworkManager. If set to false, then any interface listed in /etc/network/interfaces
	will be ignored by NetworkManager. Remember that NetworkManager controls the default
	route, so because the interface is ignored, NetworkManager may assign the default
	route to some other interface.

	The default value is false.



================================================================================

我的系統裡,並沒有「/etc/network/interfaces」這個檔案

所以執行下面指令


grep '/etc/network/interfaces' /var/log/syslog



會顯示其中一段


...

Aug 1 17:42:18 sam-anywhere NetworkManager[698]: <info> [1659346938.9740] ifupdown: interfaces file /etc/network/interfaces doesn't exist

...


================================================================================

執行下面指令


grep ifupdown /var/log/syslog



會顯示其中一段


...

Aug 1 17:42:18 sam-anywhere NetworkManager[698]: <info> [1659346938.2137] monitoring ifupdown state file '/run/network/ifstate'.
Aug 1 17:42:18 sam-anywhere NetworkManager[698]: <info> [1659346938.9710] settings: Loaded settings plugin: ifupdown ("/usr/lib/x86_64-linux-gnu/NetworkManager/1.36.6/libnm-settings-plugin-ifupdown.so")
Aug 1 17:42:18 sam-anywhere NetworkManager[698]: <info> [1659346938.9714] ifupdown: management mode: unmanaged
Aug 1 17:42:18 sam-anywhere NetworkManager[698]: <info> [1659346938.9740] ifupdown: interfaces file /etc/network/interfaces doesn't exist

...


================================================================================

以上簡易探索紀錄

提供您參考

也許能讓您有可以探索的起點,關於您在「#4」提到的疑問。

報告完畢



================================================================================

[回到索引]

================================================================================

8/3 0:06:38
應用擴展 工具箱

« 1 (2)

 [無發表權] 請登錄或者註冊


可以查看帖子.
不可發帖.
不可回覆.
不可編輯自己的帖子.
不可刪除自己的帖子.
不可發起投票調查.
不可在投票調查中投票.
不可上傳附件.
不可不經審核直接發帖.