查看RFC for TCP: RFC 793 – Transmission Control Protocol,答案似乎是否定的,因为源头/目标端口字段的TCP头限制为16位.
IPv6改进了吗?
不会.虽然IPv6会为我们提供更大的IP地址空间,32位与128位,但它并没有尝试改善端口号的16位TCP数据包限制.有趣的是RFC for IPv6:Internet Protocol, Version 6 (IPv6) Specification,IP字段需要扩展.
When TCP runs over IPv6, the method used to compute the checksum is changed, as per 07002:
Any transport or other upper-layer protocol that includes the addresses from the IP header in its checksum computation must be modified for use over IPv6, to include the 128-bit IPv6 addresses instead of 32-bit IPv4 addresses.
那么如何获得更多端口?
一种方法是使用更多接口堆叠其他IP地址.如果您的系统有多个NIC,这更容易,但即使只有一个NIC,也可以使用虚拟接口(也称为aliases)在需要时分配更多IP.
注意:使用别名已被iproute2取代,您可以使用它来在单个接口(即eth0)上堆叠IP地址.
例
$sudo ip link set eth0 up
$sudo ip addr add 192.0.2.1/24 dev eth0
$sudo ip addr add 192.0.2.2/24 dev eth0
$ip addr show dev eth0
2: eth0: mtu 1500 qdisc
pfifo_fast state DOWN qlen 1000
link/ether 00:d0:b7:2d:ce:cf brd ff:ff:ff:ff:ff:ff
inet 192.0.2.1/24 brd 192.0.2.255 scope global eth1
inet 192.0.2.2/24 scope global secondary eth1
资料来源:iproute2: Life after ifconfig
参考
> OpenWrt Wiki » Documentation » Networking » Linux Network Interfaces
> Some useful command with iproute2
> Linux Advanced Routing & Traffic Control HOWTO
> Multiple default routes / public gateway IPs under Linux
> iproute2 cheat sheet – Daniil Baturin’s website