全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 1405|回复: 15

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

[复制链接]
发表于 2020-1-1 11:54:06 | 显示全部楼层 |阅读模式
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.158  netmask 255.255.240.0  broadcast 172.26.15.255
        inet6 fe80::417:e2ff:fee0:88fc  prefixlen 64  scopeid 0x20<link>
        ether 06:17:e2:e0:88:fc  txqueuelen 1000  (Ethernet)
        RX packets 1226  bytes 1172400 (1.1 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 762  bytes 85570 (85.5 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 188  bytes 14873 (14.8 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 188  bytes 14873 (14.8 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
公网ip是52.194.开头的
如果dd win的话,ip填哪个?52.194开头的还是172.26.14.158这个内网ip?网关是172.26.0.1么?掩码是0.0.0.0么?
发表于 2020-1-1 11:55:07 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
 楼主| 发表于 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又是怎么联系的呢?

点评

BOC
你自己去看看 255.255.240.0 代表几个C吧  发表于 2020-1-1 12:51
发表于 2020-1-1 12:28:58 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2020-1-1 12:41:46 | 显示全部楼层
vnc底部有写  ...
 楼主| 发表于 2020-1-1 13:04:16 | 显示全部楼层
本帖最后由 plumn 于 2020-1-1 13:07 编辑
hellfires 发表于 2020-1-1 12:28
inet 172.26.14.158  netmask 255.255.240.0  broadcast 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鸡就好,尽量不给大家添麻烦,能解决问题就好
发表于 2020-1-1 13:59:50 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
 楼主| 发表于 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.158  netmask(网络掩码) 255.255.240.0  broadcast (广播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
答案是什么我不清楚。
当然了,二楼说的有答案,但是我完全不明白,可能他的就是我要的正确答案,是我太小白了
发表于 2020-1-1 14:14:58 | 显示全部楼层
此类云服务的公网ip都是static nat到内网ip,根本不用你管,你把内网配置对了就没问题了
发表于 2020-1-1 14:21:47 | 显示全部楼层
这里不是都显示出来了?

  1. root@ip-172-26-14-158:~# route
  2. Kernel IP routing table
  3. Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
  4. default         ip-172-26-0-1.a 0.0.0.0         UG    100    0        0 eth0
  5. 172.26.0.0      0.0.0.0         255.255.240.0   U     0      0        0 eth0
  6. ip-172-26-0-1.a 0.0.0.0         255.255.255.255 UH    100    0        0 eth0
  7. root@ip-172-26-14-158:~# ip route
  8. default via 172.26.0.1 dev eth0 proto dhcp src 172.26.14.158 metric 100
  9. 172.26.0.0/20 dev eth0 proto kernel scope link src 172.26.14.158
  10. 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
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-3-29 16:32 , Processed in 0.070530 second(s), 13 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表