使用 "cat"和 "echo" 是進入 /proc-filesystem的最簡單方法. 但必需具備下面幾個條件:
# mount | grep "type proc"
none on /proc type proc (rw)
通常/proc/sys/* 都是可寫的, 其它的都是只讀或只提供相關資訊.
可以使用 "cat" 得到一個值.
# cat /proc/sys/net/ipv6/conf/all/forwarding
0
可以使用 "echo" 設定一個值.
# echo "1" >/proc/sys/net/ipv6/conf/all/forwarding
使用 "sysctl" 設定核心是當前流行的方法, 您也能用. 如果/proc-filesystem 沒有掛進來, 那麼您只可以訪問/proc/sys/*
"sysctl"程式在"procps"安裝包中.(Red Hat Linux systems)
sysctl-interface 需要在核心中進行激活, 在編譯的時候可以通過以下選項完成:
CONFIG_SYSCTL=y
A new value can be set (if entry is writable):
# sysctl -w net.ipv6.conf.all.forwarding=1
net.ipv6.conf.all.forwarding = 1
在 "=" 兩邊不能出現spaces符號,也不能像下面那樣一次設定多個值:
# sysctl -w net.ipv4.ip_local_port_range="32768 61000"
net.ipv4.ip_local_port_range = 32768 61000
sysctl使用 "/" 代替 "." 詳細資訊請看sysctl的manpage
提示:快速查找設定的資訊,可以聯合使用帶"-a"的grep.
Change the interface-specific default settings
改變所有 interface-specific 設定.
除了: "conf/all/forwarding" 它有不同的含義.
在兩個界面之間進行global IPv6 forwarding (數據包轉寄.)
IPv6 當中您不能單獨控制一個設備的 forwarding (數據包轉寄). forwarding 的控制由IPv6-netfilter 完成. 當值為"0"時 數據包轉寄的能力被關閉,數據包不會離開各自的界面(包括物理/虛擬)比如 tunnel. 當值為"1"時 數據包轉寄的能力被開啟.
改變單個界面的設定. 依據local forwarding 是 enabled 或 not.
接受IPv6路由廣告.並且根據得到的信息自動設定.
接受IPv6路由器的重定向.
設定本地連結地址使用L2硬體地址. 它依據界面的L2-MAC address自動產生一個地址如:"fe80::201:23ff:fe45:6789"
發送重複地址嗅探的總數.
設定主機/路由的interface-specific動作.
注意:推薦所有interface(界面)使用相同的設定.混合路由器/主機的想法真是難得.
缺省hop限制.
缺省最大傳輸單元.
在發送路由請求之前界面的等待時間(秒).
在每個路由請求之間的等待時間(秒).
假定沒有路由的情況下發送的請求個數.
Change default settings for neighbor detection and some special global interval and threshold values:
More to be filled.
More to be filled.
芳鄰列印表大小的調節項.
如果您有許多界面,或路由表現反常 試著增大數值. Or if a running Zebra (routing daemon) reports:
ZEBRA: netlink-listen error: No buffer space available, type=RTM_NEWROUTE(24), seq=426, pid=0
More to be filled.
Change special settings per interface for neighbor detection.
More to be filled.
More to be filled.
More to be filled.
More to be filled.
More to be filled.
More to be filled.
More to be filled.
More to be filled.
More to be filled.
More to be filled.
More to be filled.
More to be filled.
設定global(全局)路由
Removed in newer kernel releases - more to be filled.
More to be filled.
More to be filled.
More to be filled.
More to be filled.
More to be filled.
More to be filled.
More to be filled.
More to be filled.
目前(直到IPv4全部成為核心模組),一些開關也可以為IPv6所使用.
也可以為IPv6使用.
也可以為IPv6使用.
不能為IPv6使用. 激活 ICMPv6 比率限制 rate limting (極力推薦,因為它有抵禦 ICMPv6 網路風暴的能力) netfilter-v6 rules must be used.
不知道, 不能為IPv6使用吧.
這個地方是只讀的, 您不能通過 "sysctl" 得到資訊,可以使用 "cat"
每一行地址包含多個值.
這裡IPv6地址是用特殊的格式列印的,例子只列印環繞interface(界面)含義在下面
# cat /proc/net/if_inet6
00000000000000000000000000000001 01 80 10 80 lo
+------------------------------+ ++ ++ ++ ++ ++
| | | | | |
1 2 3 4 5 6
1. 地址用32個不包含":"的十六進制列印.
2. 連結的設備數值(interface index)使用十六進制列印.
3. 前綴的長度使用十六進制列印.
4. Scope value (see kernel source " include/net/ipv6.h" and "net/ipv6/addrconf.c" for more)
5. Interface flags (see "include/linux/rtnetlink.h" and "net/ipv6/addrconf.c" for more)
6. 設備名.
每一行地址包含多個值.
這裡IPv6地址是用特殊的格式列印的,例子只列印環繞interface(界面)含義在下面
# cat /proc/net/ipv6_route
00000000000000000000000000000000 00 00000000000000000000000000000000 00
+------------------------------+ ++ +------------------------------+ ++
| | | |
1 2 3 4
? 00000000000000000000000000000000 ffffffff 00000001 00000001 00200200 lo
? +------------------------------+ +------+ +------+ +------+ +------+ ++
? | | | | | |
? 5 6 7 8 9 10
1. IPv6目標網路用32個不包含":"的十六進制列印.
2. IPv6prefix(前綴)的長度使用十六進制列印.
3. IPv6來源網路用32個不包含":"的十六進制列印.
4. IPv6來源prefix(前綴)的長度使用十六進制列印.
5. IPv6下一個hop(躍點)用32個不包含":"的十六進制列印.
6. Metric in hexadecimal
7. Reference counter
8. Use counter
9. Flags(標緻)
10.Device name
每一行地址包含多個值.
IPv6 sockets統計:
# cat /proc/net/sockstat6
TCP6: inuse 7
UDP6: inuse 2
RAW6: inuse 1
FRAG6: inuse 0 memory 0
tcp6
To be filled.
udp6
To be filled.
igmp6
To be filled.
raw6
To be filled.
ip6_flowlabel
To be filled.
rt6_stats
To be filled.
snmp6
Type: One line per SNMP description and value
SNMP statistics, can be retrieved via SNMP server and related MIB table by network management software.
ip6_tables_names
Available netfilter6 tables