IP子网( Subnets) IP地址具有相同网络号的设备接口 不跨越路由器(第三及以上层网络设备)可以彼此物理联通的接口 我们将ip地址分为两部分,高位比特部分,我们当作网络号,凡是相同的,则说明属于同一个子网
R4#sho ip route ospf 1.0.0.0/32 is subnetted, 1 subnets O IA 1.1.1.1 [110/129] via 34.0.0.3 , 00:00:29, Serial0/0 2.0.0.0/32 is subnetted, 1 subnets O IA 2.2.2.2 [110/193] via 34.0.0.3 , 00:00:29, Serial0/0 3.0.0.0/32 is subnetted, 1 subnets O 3.3.3.3 [110/65] via 34.0.0.3 O 1.1.1.1 [110/65] via 12.0.0.1, 00:05:38, Serial0/0 3.0.0.0/32 is subnetted, 1 subnets O IA 3.3.3.3 [110/129] via 12.0.0.1, 00:03:01, Serial0/0 4.0.0.0/32 is subnetted, 1 subnets
1、基本配置完成后,查看R1路由 1.0.0.0/24 is subnetted, 1 subnets C 1.1.1.0 is directly connected, Loopback0 5.0.0.0/24 is subnetted, 1 subnets D 5.5.5.0 [90/158720] via 11.1.1.3, 00:05:16, FastEthernet0/ 0 10.0.0.0/24 is subnetted, 1 subnets C 10.1.1.0 is directly connected, Serial0/0 11.0.0.0/24 is subnetted, 1 subnets C 11.1.1.0 is directly connected, FastEthernet0/0 12.0.0.0/24 is subnetted , 1 subnets D 14.1.1.0 [90/2565120] via 10.1.1.2, 00:00:06, Serial0/0 其中到5.5.5.5的路由,是通过R3转发的,度量值是
C 2.2.2.0 is directly connected, Loopback0 3.0.0.0/24 is subnetted, 4 subnets O IA 3.3.0.0 C 2.2.2.0 is directly connected, Loopback0 3.0.0.0/24 is subnetted, 3 subnets O IA 3.3.0.0 [110/129] via 12.1.1.1, 00:04:31, Serial2/0 12.0.0.0/24 is subnetted, 1 subnets C 12.1.1.0 is directly connected, Serial2/0 13.0.0.0/24 is subnetted, 1 subnets O IA 13.1.1.0 [110/128] is directly connected, Serial2/0 13.0.0.0/24 is subnetted, 1 subnets O IA 13.1.1.0 [110/128]
O 3.3.3.0 [110/782] via 134.1.1.3, 00:11:56, Serial0/0 4.0.0.0/24 is subnetted, 1 subnets O 1.1.1.0 [110/782] via 134.1.1.1, 00:00:16, Serial0/1 4.0.0.0/24 is subnetted, 1 subnets 1.1.1.0 [110/782] via 134.1.1.1, 00:00:35, Serial0/1 3.0.0.0/24 is subnetted, 1 subnets O 加上这两条命令后: R3#show ip route ospf 1.0.0.0/24 is subnetted, 1 subnets O 1.1.1.0 [110/782 ] via 134.1.1.1, 00:04:15, Serial0/1 4.0.0.0/24 is subnetted, 1 subnets O 4.4.4.0 [110
("\n/25 subnets in {}:", net); // /25 subnets in 192.168.0.0/23: // `subnets()` 返回一个 `Result`。 如果给定的前缀长度小于现有的前缀长度,“结果”将包含错误 let subnets = net .subnets(25) .expect("PrefixLenError ("\n/0 or greater subnets between {} and {}:", start, end); // 输出所有子网,从适合的最大子网开始。 = Ipv4Subnets::new(start, end, 0); for (i, n) in subnets.enumerate() { println! = Ipv4Subnets::new(start, end, 26); for (i, n) in subnets.enumerate() { println!
n_subnets = bits.count('0') n_hosts = bits.count('1') # 返回格式化后的字符串,其中包括给定IP地址、可用子网数和主机数。 return f'Subnet: {subnet}, subnets: {2**n_subnets}, hosts per subnet: {2**n_hosts}' # 对subnet_masks中每个 for subnet in subnet_masks: print(subnet_details(subnet)) 输出结果如下: Subnet: 127.192.0.0, subnets: 16384 , hosts per subnet: 1024 Subnet: 96.0.0.0, subnets: 16777216, hosts per subnet: 256 Subnet: 255.128.0.0 , subnets: 512, hosts per subnet: 32768 Subnet: 176.0.0.0, subnets: 4194304, hosts per subnet: 1024 可以看到
/ca.crt --cert-file /etc/etcd/etcd-client.crt --key-file /etc/etcd/etcd-client.key ls /cloudnetwork/subnets ca.crt --cert-file /etc/etcd/etcd-client.crt --key-file /etc/etcd/etcd-client.key get /cloudnetwork/subnets ca.crt --cert-file /etc/etcd/etcd-client.crt --key-file /etc/etcd/etcd-client.key get /cloudnetwork/subnets ca.crt --cert-file /etc/etcd/etcd-client.crt --key-file /etc/etcd/etcd-client.key get /cloudnetwork/subnets ca.crt --cert-file /etc/etcd/etcd-client.crt --key-file /etc/etcd/etcd-client.key get /cloudnetwork/subnets
/ca.crt --cert-file /etc/etcd/etcd-client.crt --key-file /etc/etcd/etcd-client.key ls /cloudnetwork/subnets ca.crt --cert-file /etc/etcd/etcd-client.crt --key-file /etc/etcd/etcd-client.key get /cloudnetwork/subnets ca.crt --cert-file /etc/etcd/etcd-client.crt --key-file /etc/etcd/etcd-client.key get /cloudnetwork/subnets ca.crt --cert-file /etc/etcd/etcd-client.crt --key-file /etc/etcd/etcd-client.key get /cloudnetwork/subnets ca.crt --cert-file /etc/etcd/etcd-client.crt --key-file /etc/etcd/etcd-client.key get /cloudnetwork/subnets
formatted as shown in the examples below, that identifies the node and the number of fully connected subnets 2 3 3 4 4 5 5 1 0 1 2 2 3 3 4 4 6 6 3 2 5 5 1 0 0 Sample Output Network #1 SPF node 3 leaves 2 subnets Network #2 No SPF nodes Network #3 SPF node 2 leaves 2 subnets SPF node 3 leaves 2 subnets Source flag=1; printf("Network #%d\n",++cur); if(ans[1]>1) printf(" SPF node %d leaves %d subnets for(int i=2;i<=N;i++) if(ans[i]>=1) printf(" SPF node %d leaves %d subnets
O E2 1.1.1.10 [110/10] via 192.168.1.6, 00:00:06, Serial1/0 3.0.0.0/32 is subnetted, 1 subnets O E2 is directly connected, Loopback1 7.0.0.0/32 is subnetted, 1 subnets C 7.7.7.7 is directly connected /0 12.0.0.0/24 is subnetted, 1 subnets O E2 12.1.1.0 [110/10] via 192.168.1.6, 00:00:06, Serial1/0 192.168.1.0/30 is subnetted, 3 subnets C 192.168.1.8 is directly connected, Serial1/2 O 192.168.1.0 [ O E2 1.1.1.10 [110/10] via 192.168.1.9, 00:00:55, Serial1/2 3.0.0.0/32 is subnetted, 1 subnets O E2
"github.com/projectdiscovery/mapcidr" ) func main() { // Divide the CIDR into two subnets subnets1 := mapcidr.SplitN("192.168.1.0/24", 2) for _, subnet := range subnets1 { fmt.Println(subnet) } // Divide the CIDR into two subnets containing 128 hosts each subnets2 := mapcidr.SplitByNumber("192.168.1.0/24", 128) for _, subnet := range subnets2 { fmt.Println(subnet) } // List all ips in the
/etcdctl ls /coreos.com/network/subnets 检查得到的结果是不是给你的 subnet.env 里面配置的网络在同一网段,如果是检查路由表,查看是否自动添加路由 route /etcdctl rm /coreos.com/network/subnets/172.16.27.0-24 ETCDCTL_API=2 . /etcdctl rm /coreos.com/network/subnets/172.16.56.0-24 ETCDCTL_API=2 . /etcdctl rmdir /coreos.com/network/subnets 3, 删除路由表 route del -net 172.16.88.0/24 gw 172.16.88.1 4, 删除
" { value = tencentcloud_subnet.my_subnets[*]}terraform planterraform plan -var-file=credentials.tfvars " { value = tencentcloud_subnet.my_subnets[*]}resource "tencentcloud_security_group" "zhangpeng_sg" " { value = tencentcloud_subnet.my_subnets[*]}resource "tencentcloud_security_group" "zhangpeng_sg" " { value = tencentcloud_subnet.my_subnets[*]}resource "tencentcloud_security_group" "zhangpeng_sg" " { value = tencentcloud_subnet.my_subnets[*]}resource "tencentcloud_security_group" "zhangpeng_sg"
$ etcdctl ls /coreos.com/network/subnets /coreos.com/network/subnets/100.96.1.0-24 /coreos.com /network/subnets/100.96.2.0-24 /coreos.com/network/subnets/100.96.3.0-24 $ etcdctl get/coreos.com /network/subnets/100.96.2.0-24 {"PublicIP":"10.168.0.3"} Flannel UDP网络通信过程分析 从容器中eth0网卡到docker0的过程,
kubernetes/ssl/kubernetes.pem \ --key-file=/etc/kubernetes/ssl/kubernetes-key.pem \ ls /k8s-ks/network/subnets ignoring ServerName for user-provided CA for backwards compatibility is deprecated /k8s-ks/network/subnets /172.30.25.0-24 /k8s-ks/network/subnets/172.30.99.0-24 /k8s-ks/network/subnets/172.30.59.0-24 # etcdctl kubernetes/ssl/kubernetes.pem \ --key-file=/etc/kubernetes/ssl/kubernetes-key.pem \ get /k8s-ks/network/subnets kubernetes/ssl/kubernetes.pem \ --key-file=/etc/kubernetes/ssl/kubernetes-key.pem \ get /k8s-ks/network/subnets
periodic downloaded static route Gateway of last resort is not set 1.0.0.0/24 is subnetted, 1 subnets C 1.1.1.0 is directly connected, Loopback0 2.0.0.0/24 is subnetted, 1 subnets R 2.2.2.0 [120/1] via 12.1.1.2, 00:00:09, Serial0/0 3.0.0.0/24 is subnetted, 1 subnets R 3.3.3.0 [120 /2] via 12.1.1.2, 00:00:09, Serial0/0 12.0.0.0/24 is subnetted, 1 subnets C 12.1.1.0 is directly connected, Serial0/0 13.0.0.0/24 is subnetted, 1 subnets R 13.1.1.0 [120/1] via 12.1.1.2,
/etcdctl ls /coreos.com/network/subnets 检查得到的结果是不是给你的 subnet.env 里面配置的网络在同一网段,如果是检查路由表,查看是否自动添加路由 route /etcdctl rm /coreos.com/network/subnets/172.16.27.0-24 ETCDCTL_API=2 . /etcdctl rm /coreos.com/network/subnets/172.16.56.0-24 ETCDCTL_API=2 . /etcdctl rmdir /coreos.com/network/subnets 3, 删除路由表 route del -net 172.16.88.0/24 gw 172.16.88.1 4, 删除
R3(config-if)#do show ip rout 1.0.0.0/32 is subnetted, 1 subnets O IA 1.1.1.1 [110/129] via 23.1.1.2 , 00:00:44, Serial0/1 2.0.0.0/32 is subnetted, 1 subnets O IA 2.2.2.2 [110/65] via 23.1.1.2, 00:00:44 , Serial0/1 3.0.0.0/24 is subnetted, 1 subnets C 3.3.3.0 is directly connected, Loopback0 23.0.0.0/ 24 is subnetted, 1 subnets C 23.1.1.0 is directly connected, Serial0/1 12.0.0.0/24 is subnetted, 1 subnets
D 1.1.1.0 [90/2297856] via 192.168.123.1, 00:01:02, Serial0/0 2.0.0.0/24 is subnetted, 1 subnets C 2.2.2.0 R1(config-if)#no ip split-horizon eigrp 90 \\关闭 水平 分割 R2#sh ip rou eig 1.0.0.0/24 is subnetted, 1 subnets D 1.1.1.0 [90/2297856] via 192.168.123.1, 00:04:16, Serial0/0 3.0.0.0/24 is subnetted, 1 subnets D 3.3.3.0 config-if)#no ip next-hop-self eigrp 90 \\开启第三方下一跳 R2#sh ip route eigrp 1.0.0.0/24 is subnetted, 1 subnets D 1.1.1.0 [90/2297856] via 192.168.123.1, 00:00:31, Serial0/0 3.0.0.0/24 is subnetted, 1 subnets D 3.3.3.0