跳至主要內容
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?

4563博客

全新的繁體中文 WordPress 網站
  • 首頁
  • aws的lightsail怎么看网关ip和掩码?
未分類
6 2 月 2020

aws的lightsail怎么看网关ip和掩码?

plumn 大佬有话说 : 2020-1-1 11:54:06

aws的lightsail怎么看网关ip和掩码?

ubuntu@ip-172-26-14-158:~$ sudo -s
root@ip-172-26-14-158:~# route
Kernel IP routing table
Destination   Gateway         Genmask         Flags Metric Ref    Use Iface
default         ip-172-26-0-1.a 0.0.0.0         UG    100    0      0 eth0
172.26.0.0      0.0.0.0         255.255.240.0   U   0      0      0 eth0
ip-172-26-0-1.a 0.0.0.0         255.255.255.255 UH    100    0      0 eth0
root@ip-172-26-14-158:~# ip route
default via 172.26.0.1 dev eth0 proto dhcp src 172.26.14.158 metric 100
172.26.0.0/20 dev eth0 proto kernel scope link src 172.26.14.158
172.26.0.1 dev eth0 proto dhcp scope link src 172.26.14.158 metric 100
root@ip-172-26-14-158:~# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>mtu 9001
      inet 172.26.14.158netmask 255.255.240.0broadcast 172.26.15.255
      inet6 fe80::417:e2ff:fee0:88fcprefixlen 64scopeid 0x20<link>
      ether 06:17:e2:e0:88:fctxqueuelen 1000(Ethernet)
      RX packets 1226bytes 1172400 (1.1 MB)
      RX errors 0dropped 0overruns 0frame 0
      TX packets 762bytes 85570 (85.5 KB)
      TX errors 0dropped 0 overruns 0carrier 0collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>mtu 65536
      inet 127.0.0.1netmask 255.0.0.0
      inet6 ::1prefixlen 128scopeid 0x10<host>
      looptxqueuelen 1000(Local Loopback)
      RX packets 188bytes 14873 (14.8 KB)
      RX errors 0dropped 0overruns 0frame 0
      TX packets 188bytes 14873 (14.8 KB)
      TX errors 0dropped 0 overruns 0carrier 0collisions 0
公网ip是52.194.开头的
如果dd win的话,ip填哪个?52.194开头的还是172.26.14.158这个内网ip?网关是172.26.0.1么?掩码是0.0.0.0么?

BOC 大佬有话说 : 2020-1-1 11:55:07

255.255.240.0    172.26.0.1

plumn 大佬有话说 : 2020-1-1 11:59:43

BOC 大佬有话说 : 2020-1-1 11:55
255.255.240.0    172.26.0.1

不是default那条么?ip 172.26.0.0和内网ip172.26.14.158又是怎么联系的呢?

hellfires 大佬有话说 : 2020-1-1 12:28:58

inet 172.26.14.158netmask 255.255.240.0broadcast 172.26.15.255

你还是去学学计算机网络吧,不行就去百度网关计算器

ljm1447669873 大佬有话说 : 2020-1-1 12:41:46

vnc底部有写…

plumn 大佬有话说 : 2020-1-1 13:04:16

本帖最后由 plumn 于 2020-1-1 13:07 编辑

hellfires 大佬有话说 : 2020-1-1 12:28
inet 172.26.14.158netmask 255.255.240.0broadcast 172.26.15.255

你还是去学学计算机网络吧,不行就 …

一句学习计算机网络把问题说的太轻巧了,没有大半个月学不透这些基础,而且学了也不见得明白aws的实际应用的网络部署,网关计算,ip段计算主要是计算/24这些ip总数,我看了半天相关知识也没一个人解释 ip-172-26-0-1.a这是什么ip书写模式,默认网卡eth0的内网inet ip 172.26.14.158,掩码255.255.240.0,广播ip 172.26.15.255我都贴出来了,自然知道这些,但是广播ip172.26.15.255是广播给谁的,又是怎么和公网52.192开头ip的通信,从哪查也没找到
Destination   Gateway         Genmask         Flags Metric Ref    Use Iface
default         ip-172-26-0-1.a 0.0.0.0         UG    100    0      0 eth0
172.26.0.0      0.0.0.0         255.255.240.0   U   0      0      0 eth0
ip-172-26-0-1.a 0.0.0.0         255.255.255.255 UH    100    0      0 eth0
这个路由表存在的道理是什么,读死书一时半会也研究不来,我看了普通的vps直接就一个default就解决问题,这个绕三条路由是干嘛用的,网络上查只查的出U是指使用中,G是指网关Gate,那个H是啥也查不到,
我承认我也知道自己是网络小白,所以把问题弄简单点,dd win , ip address , gate , mask 对应我查出来的数据,是以哪条有效就好,其他的学了半个月没学会也没啥意义,vps对我只是休闲乐趣,如果大佬觉得实在难解释,我去开个win鸡就好,尽量不给大家添麻烦,能解决问题就好

cyclists 大佬有话说 : 2020-1-1 13:59:50

plumn 大佬有话说 : 2020-1-1 13:04
一句学习计算机网络把问题说的太轻巧了,没有大半个月学不透这些基础,而且学了也不见得明白aws的实际应 …

就跟家里的路由器怎么通外网一样

plumn 大佬有话说 : 2020-1-1 14:12:03

本帖最后由 plumn 于 2020-1-1 14:13 编辑

cyclists 大佬有话说 : 2020-1-1 13:59
就跟家里的路由器怎么通外网一样

我知道路由器怎么上外网,本地怎么配置ip,刷固件都会,我也玩过各种杜甫,vps,别家的路由怎么走我看的懂,然而这解决不了我的疑问,我上面列出的aws路由和网关配置,dd win的话,ip_addr=?,ip_Gate=? Ip_Mask=?这个问题没有正面回答我的,当然,这不是大家的义务
已有的数据我也看的到:

inet(内网ip) 172.26.14.158netmask(网络掩码) 255.255.240.0broadcast (广播ip)172.26.15.255
Destination   Gateway         Genmask         Flags Metric Ref    Use Iface
default         ip-172-26-0-1.a 0.0.0.0         UG    100    0      0 eth0
172.26.0.0      0.0.0.0         255.255.240.0   U   0      0      0 eth0
ip-172-26-0-1.a 0.0.0.0         255.255.255.255 UH    100    0      0 eth0
公网ip 52.194.xx.xxx
答案是什么我不清楚。
当然了,二楼说的有答案,但是我完全不明白,可能他的就是我要的正确答案,是我太小白了

affyun.org 大佬有话说 : 2020-1-1 14:14:58

此类云服务的公网ip都是static nat到内网ip,根本不用你管,你把内网配置对了就没问题了

xayle 大佬有话说 : 2020-1-1 14:21:47

这里不是都显示出来了?

root@ip-172-26-14-158:~# route
Kernel IP routing table
Destination   Gateway         Genmask         Flags Metric Ref    Use Iface
default         ip-172-26-0-1.a 0.0.0.0         UG    100    0      0 eth0
172.26.0.0      0.0.0.0         255.255.240.0   U   0      0      0 eth0
ip-172-26-0-1.a 0.0.0.0         255.255.255.255 UH    100    0      0 eth0
root@ip-172-26-14-158:~# ip route
default via 172.26.0.1 dev eth0 proto dhcp src 172.26.14.158 metric 100
172.26.0.0/20 dev eth0 proto kernel scope link src 172.26.14.158
172.26.0.1 dev eth0 proto dhcp scope link src 172.26.14.158 metric 100

网关 172.26.0.1, ip 172.26.14.158, 子网掩码 255.255.240.0

文章導覽

上一篇文章
下一篇文章

AD

其他操作

  • 登入
  • 訂閱網站內容的資訊提供
  • 訂閱留言的資訊提供
  • WordPress.org 台灣繁體中文

51la

4563博客

全新的繁體中文 WordPress 網站
返回頂端
本站採用 WordPress 建置 | 佈景主題採用 GretaThemes 所設計的 Memory
4563博客
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?
在這裡新增小工具