when bring back dhcp normal file all works ... why static IP conn Not working

Issues related to configuring your network
Post Reply
lse123new
Posts: 66
Joined: 2014/05/01 15:48:05

when bring back dhcp normal file all works ... why static IP conn Not working

Post by lse123new » 2018/06/19 21:00:52

http://192.168.10.254/ this is my gateway in windows 10 host

means is the same for VM guest Cent OS 7 server...????

I try

set static IP but lost connection... ???

is below steup correct????

IPADDR=192.168.133.131
NETMASK=255.255.255.0
# BROADCAST=255.255.255.255

GATEWAY=192.168.133.254

^^^^^<<<<<<<<<<<<< these are ok ?????



[root@server8new2 network-scripts]# ping -c 10 google.com
connect: Network is unreachable
[root@server8new2 network-scripts]# systemctl restart network
[root@server8new2 network-scripts]# ping -c 10 google.com
PING google.com (216.58.212.46) 56(84) bytes of data.

--- google.com ping statistics ---
10 packets transmitted, 0 received, 100% packet loss, time 9016ms

[root@server8new2 network-scripts]# cat ifcfg-ens33
TYPE="Ethernet"
PROXY_METHOD="none"
NM_CONTROLLED="no"
BROWSER_ONLY="no"
BOOTPROTO="none"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="yes"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="ens33"
UUID="ab1d9220-deb8-4538-8273-9ef66bf36ad6"
DEVICE="ens33"

IPADDR=192.168.133.131
NETMASK=255.255.255.0
# BROADCAST=255.255.255.255

GATEWAY=192.168.133.254

ONBOOT="yes"


[root@server8new2 network-scripts]#







when bring back dhcp normal file all works ... why static IP conn Not working

[root@server8new2 network-scripts]# systemctl restart network
[root@server8new2 network-scripts]# ping -c 10 google.com
PING google.com (172.217.17.174) 56(84) bytes of data.
64 bytes from sof02s21-in-f14.1e100.net (172.217.17.174): icmp_seq=1 ttl=128 time=53.5 ms
64 bytes from sof02s21-in-f14.1e100.net (172.217.17.174): icmp_seq=2 ttl=128 time=54.4 ms
64 bytes from sof02s21-in-f14.1e100.net (172.217.17.174): icmp_seq=3 ttl=128 time=57.0 ms
64 bytes from sof02s21-in-f14.1e100.net (172.217.17.174): icmp_seq=4 ttl=128 time=53.4 ms
64 bytes from sof02s21-in-f14.1e100.net (172.217.17.174): icmp_seq=5 ttl=128 time=54.0 ms
64 bytes from sof02s21-in-f14.1e100.net (172.217.17.174): icmp_seq=6 ttl=128 time=54.6 ms
64 bytes from sof02s21-in-f14.1e100.net (172.217.17.174): icmp_seq=7 ttl=128 time=53.2 ms
64 bytes from sof02s21-in-f14.1e100.net (172.217.17.174): icmp_seq=8 ttl=128 time=53.2 ms

--- google.com ping statistics ---
8 packets transmitted, 8 received, 0% packet loss, time 7014ms
rtt min/avg/max/mdev = 53.236/54.194/57.011/1.206 ms
[root@server8new2 network-scripts]# cat ifcfg-ens33
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="dhcp"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="ens33"
UUID="ab1d9220-deb8-4538-8273-9ef66bf36ad6"
DEVICE="ens33"
ONBOOT="yes"
[root@server8new2 network-scripts]#

tunk
Posts: 441
Joined: 2017/02/22 15:08:17

Re: when bring back dhcp normal file all works ... why static IP conn Not working

Post by tunk » 2018/06/19 21:32:24

Try:
IPADDR=192.168.10.131
NETMASK=255.255.255.0
GATEWAY=192.168.10.254
You should also check the DHCP and fixed ranges on your router.

lse123new
Posts: 66
Joined: 2014/05/01 15:48:05

Re: when bring back dhcp normal file all works ... why static IP conn Not working

Post by lse123new » 2018/06/20 11:36:51

how find GATEWAY address? with

route

lse123new
Posts: 66
Joined: 2014/05/01 15:48:05

Re: when bring back dhcp normal file all works ... why static IP conn Not working

Post by lse123new » 2018/06/20 11:44:58

[root@server8new2 network-scripts]# ROUTE
-bash: ROUTE: command not found
[root@server8new2 network-scripts]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.133.2 0.0.0.0 UG 100 0 0 ens33
192.168.133.0 0.0.0.0 255.255.255.0 U 100 0 0 ens33
[root@server8new2 network-scripts]#

what is GATEWAY if getting this ^^^^ .. ?

User avatar
TrevorH
Forum Moderator
Posts: 23871
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: when bring back dhcp normal file all works ... why static IP conn Not working

Post by TrevorH » 2018/06/20 12:00:28

It's what you typed in your ifcfg file!
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

tunk
Posts: 441
Joined: 2017/02/22 15:08:17

Re: when bring back dhcp normal file all works ... why static IP conn Not working

Post by tunk » 2018/06/20 12:16:48

What's the IP when run in dhcp mode?
I would guess they need to be in the same subnet, i.e. 192.168.10.0/24.

lse123new
Posts: 66
Joined: 2014/05/01 15:48:05

Re: when bring back dhcp normal file all works ... why static IP conn Not working

Post by lse123new » 2018/06/20 13:08:41

Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.133.2


is Not the 192.168.133.2

???

if Not
if typed this is this?

Linux machines connected on local network have same GATEWAY IP all ?

lse123new
Posts: 66
Joined: 2014/05/01 15:48:05

Re: when bring back dhcp normal file all works ... why static IP conn Not working

Post by lse123new » 2018/06/20 13:32:05

after set static IP...

how understand that indeed this PC uses static IP.... ? where in the system the word "static" makes static address ???

tunk
Posts: 441
Joined: 2017/02/22 15:08:17

Re: when bring back dhcp normal file all works ... why static IP conn Not working

Post by tunk » 2018/06/20 13:48:41

ifconfig should list all defined network interfaces.
And why not use dhcp when it works?

lse123new
Posts: 66
Joined: 2014/05/01 15:48:05

Re: when bring back dhcp normal file all works ... why static IP conn Not working

Post by lse123new » 2018/06/20 15:08:59

Practicing static address ....

exam LFCS ADMIN
and
old pc to use as home server

Post Reply