Page 1 of 2

Unable to set static ip on "bridged" network

Posted: 2019/06/03 15:38:34
by thewall83
Dear all,
I'm trying to setup a Centos 7 server on a VMware 12 virtual machine.
I have been able to setup the server and the network with dhcp (with VM network configuration as NAT).

But when I set the network with static ip (VM network configured as "bridged") i don't have any network service (internal or external).

I didn't find any similar question so i'm asking to you if there is a way to obtain a solution.

Re: Unable to set static ip on "bridged" network

Posted: 2019/06/03 15:42:10
by TrevorH
But when I set the network with static ip (VM network configured as "bridged") i don't have any network service (internal or external).
And is the interface still set to use DHCP? If so, do you have a working DHCP server on that LAN?

If it's not using DHCP tehn have you specified the network configuration correctly? Perhaps post the contents of /etc/sysconfig/network-scripts/ifcfg-$interface so we can see it.

Re: Unable to set static ip on "bridged" network

Posted: 2019/06/04 07:01:53
by thewall83
I set the interface as Manual.
Shown below is the content of /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
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=02f6a883-9f0e-4725-b0a8-31dcca57ed3f
DEVICE=ens33
ONBOOT=yes
HWADDR=00:0C:29:C4:85:01
IPADDR=10.5.20.124
PREFIX=23
GATEWAY=10.5.21.251
DNS1=10.5.20.92
DNS2=10.6.203.3
DNS3=10.3.201.165

Re: Unable to set static ip on "bridged" network

Posted: 2019/06/04 13:34:17
by jlehtone
Are you talking about these:
VMware NAT: https://www.vmware.com/support/ws3/doc/ ... ml#1036868
VMware bridged: https://www.vmware.com/support/ws3/doc/ ... ml#1008297

On both cases it would be preferable to get guest's configuration from DHCP server.
On VMware NAT the DHCP server is run by the VMware.
On VMware bridged the DHCP server is running outside of the host computer.

A DHCP server can hand out "static" (aka persistent) IP address for a client. Can you configure the DHCP server(s)?
If not, do you know that you can use 10.5.20.124/23?

Did you use NetworkManager or initscripts to configure the guest's interface/connection?

Re: Unable to set static ip on "bridged" network

Posted: 2019/06/04 15:01:19
by thewall83
Yes, i'm talking about VMware bridged configuration, because I need the server to be reached from other machines on the network.

I can't configure the DHCP server(s) but I know that IP 10.5.20.124 can be used.

To configure guest's interface I used NetworkManager.

Re: Unable to set static ip on "bridged" network

Posted: 2019/06/04 16:22:14
by TrevorH
Post the output from ip addr show and ip link show and ip route show

Re: Unable to set static ip on "bridged" network

Posted: 2019/06/04 19:45:08
by jlehtone
How does the VMware host get its IP address? (It must have had one at least when you had the "NAT".)
By DHCP? If the host can get config via DHCP, why can't the guest get one too?
It would be really nice, if the owner of the network be willing to support your guest in their DHCP.

More/alternative commands to show network inside CentOS:
nmcli
nmcli dev show
nmcli con show
nmcli con show ens33

Re: Unable to set static ip on "bridged" network

Posted: 2019/06/05 09:08:41
by thewall83
TrevorH wrote:
2019/06/04 16:22:14
Post the output from ip addr show and ip link show and ip route show
ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:c4:85:01 brd ff:ff:ff:ff:ff:ff
inet 10.5.20.124/23 brd 10.5.21.255 scope global noprefixroute ens33
valid_lft forever preferred_lft forever
inet6 fe80::210c:53d6:71be:9075/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 52:54:00:52:33:9f brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
valid_lft forever preferred_lft forever
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000
link/ether 52:54:00:52:33:9f brd ff:ff:ff:ff:ff:ff
ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/ether 00:0c:29:c4:85:01 brd ff:ff:ff:ff:ff:ff
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
link/ether 52:54:00:52:33:9f brd ff:ff:ff:ff:ff:ff
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN mode DEFAULT group default qlen 1000
link/ether 52:54:00:52:33:9f brd ff:ff:ff:ff:ff:ff
ip route show
default via 10.5.21.151 dev ens33 proto static metric 100
10.5.20.0/23 dev ens33 proto kernel scope link src 10.5.20.124 metric 100
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1
jlehtone wrote:
2019/06/04 19:45:08
How does the VMware host get its IP address? (It must have had one at least when you had the "NAT".)
By DHCP? If the host can get config via DHCP, why can't the guest get one too?
It would be really nice, if the owner of the network be willing to support your guest in their DHCP.

More/alternative commands to show network inside CentOS:
nmcli
nmcli dev show
nmcli con show
nmcli con show ens33
VMware host get its static IP address (10.5.20.136) which is different from guest's one (10.5.20.124).

nmcli output
ens33: collegato to ens33
"Intel 82545EM"
ethernet (e1000), 00:0C:29:C4:85:01, hw, mtu 1500
ip4 default
inet4 10.5.20.124/23
route4 10.5.20.0/23
route4 0.0.0.0/0
inet6 fe80::210c:53d6:71be:9075/64
route6 fe80::/64
route6 ff00::/8

virbr0: collegato to virbr0
"virbr0"
bridge, 52:54:00:52:33:9F, sw, mtu 1500
inet4 192.168.122.1/24
route4 192.168.122.0/24

lo: non gestito
"lo"
loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536

virbr0-nic: non gestito
"virbr0-nic"
tun, 52:54:00:52:33:9F, sw, mtu 1500

DNS configuration:
servers: 10.5.20.92 10.6.203.3 10.3.201.165
interface: ens33

Use "nmcli device show" to get complete information about known devices and
"nmcli connection show" to get an overview on active connection profiles.

lines 1-32/33 91%...skipping...
ens33: collegato to ens33
"Intel 82545EM"
ethernet (e1000), 00:0C:29:C4:85:01, hw, mtu 1500
ip4 default
inet4 10.5.20.124/23
route4 10.5.20.0/23
route4 0.0.0.0/0
inet6 fe80::210c:53d6:71be:9075/64
route6 fe80::/64
route6 ff00::/8

virbr0: collegato to virbr0
"virbr0"
bridge, 52:54:00:52:33:9F, sw, mtu 1500
inet4 192.168.122.1/24
route4 192.168.122.0/24

lo: non gestito
"lo"
loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536

virbr0-nic: non gestito
"virbr0-nic"
tun, 52:54:00:52:33:9F, sw, mtu 1500

DNS configuration:
servers: 10.5.20.92 10.6.203.3 10.3.201.165
interface: ens33

Use "nmcli device show" to get complete information about known devices and
"nmcli connection show" to get an overview on active connection profiles.

Consult nmcli(1) and nmcli-examples(5) manual pages for complete usage details.
nmcli dev show
GENERAL.DEVICE: ens33
GENERAL.TYPE: ethernet
GENERAL.HWADDR: 00:0C:29:C4:85:01
GENERAL.MTU: 1500
GENERAL.STATE: 100 (collegato)
GENERAL.CONNECTION: ens33
GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/11
WIRED-PROPERTIES.CARRIER: on
IP4.ADDRESS[1]: 10.5.20.124/23
IP4.GATEWAY: 10.5.21.151
IP4.ROUTE[1]: dst = 10.5.20.0/23, nh = 0.0.0.0, mt = 100
IP4.ROUTE[2]: dst = 0.0.0.0/0, nh = 10.5.21.151, mt = 100
IP4.DNS[1]: 10.5.20.92
IP4.DNS[2]: 10.6.203.3
IP4.DNS[3]: 10.3.201.165
IP6.ADDRESS[1]: fe80::210c:53d6:71be:9075/64
IP6.GATEWAY: --
IP6.ROUTE[1]: dst = fe80::/64, nh = ::, mt = 100
IP6.ROUTE[2]: dst = ff00::/8, nh = ::, mt = 256, table=255

GENERAL.DEVICE: virbr0
GENERAL.TYPE: bridge
GENERAL.HWADDR: 52:54:00:52:33:9F
GENERAL.MTU: 1500
GENERAL.STATE: 100 (collegato)
GENERAL.CONNECTION: virbr0
GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/2
IP4.ADDRESS[1]: 192.168.122.1/24
IP4.GATEWAY: --
IP4.ROUTE[1]: dst = 192.168.122.0/24, nh = 0.0.0.0, mt = 0
IP6.GATEWAY: --

GENERAL.DEVICE: lo
GENERAL.TYPE: loopback
GENERAL.HWADDR: 00:00:00:00:00:00
GENERAL.MTU: 65536
GENERAL.STATE: 10 (non gestito)
GENERAL.CONNECTION: --
GENERAL.CON-PATH: --
IP4.ADDRESS[1]: 127.0.0.1/8
IP4.GATEWAY: --
IP6.ADDRESS[1]: ::1/128
IP6.GATEWAY: --
nmcli con show
NAME UUID TYPE DEVICE
ens33 02f6a883-9f0e-4725-b0a8-31dcca57ed3f ethernet ens33
virbr0 5694dadd-7622-44c5-b63f-1aeaa031995f bridge virbr0
nmcli con show ens33
connection.id: ens33
connection.uuid: 02f6a883-9f0e-4725-b0a8-31dcca57ed3f
connection.stable-id: --
connection.type: 802-3-ethernet
connection.interface-name: ens33
connection.autoconnect: sì
connection.autoconnect-priority: 0
connection.autoconnect-retries: -1 (default)
connection.auth-retries: -1
connection.timestamp: 1559732596
connection.read-only: no
connection.permissions: --
connection.zone: --
connection.master: --
connection.slave-type: --
connection.autoconnect-slaves: -1 (default)
connection.secondaries: --
connection.gateway-ping-timeout: 0
connection.metered: sconosciuto
connection.lldp: default
connection.mdns: -1 (default)
802-3-ethernet.port: --
802-3-ethernet.speed: 0
802-3-ethernet.duplex: --
802-3-ethernet.auto-negotiate: no
802-3-ethernet.mac-address: 00:0C:29:C4:85:01
802-3-ethernet.cloned-mac-address: --
802-3-ethernet.generate-mac-address-mask:--
802-3-ethernet.mac-address-blacklist: --
802-3-ethernet.mtu: auto
802-3-ethernet.s390-subchannels: --
802-3-ethernet.s390-nettype: --
802-3-ethernet.s390-options: --
802-3-ethernet.wake-on-lan: default
802-3-ethernet.wake-on-lan-password: --
ipv4.method: manual
ipv4.dns: 10.5.20.92,10.6.203.3,10.3.201.165
ipv4.dns-search: --
ipv4.dns-options: ""
ipv4.dns-priority: 0
ipv4.addresses: 10.5.20.124/23
ipv4.gateway: 10.5.21.151
ipv4.routes: --

Re: Unable to set static ip on "bridged" network

Posted: 2019/06/05 10:15:01
by jlehtone
thewall83 wrote:
2019/06/04 07:01:53
Shown below is the content of /etc/sysconfig/network-scripts/ifcfg-ens33
GATEWAY=10.5.21.251
thewall83 wrote:
2019/06/05 09:08:41

Code: Select all

ip route show
default via 10.5.21.151 dev ens33 proto static metric 100

Code: Select all

IP4.GATEWAY:                            10.5.21.151
ipv4.gateway:                           10.5.21.151
Your previous post shows 251, but outputs all show 151. How can that be? Which should it be?

However, the default gateway affects only your ability to reach outside of the link-local 10.5.20.0/23.
You should still be able to ping addresses within 10.5.20.0/23 (unless they are firewalled).

thewall83 wrote:
2019/06/05 09:08:41
VMware host get its static IP address (10.5.20.136) which is different from guest's one (10.5.20.124).
How does the VMware host get its address?

"Static" is not "how". "Static" means "same address every time". "DHCP" and "manual" can both give "static".

Re: Unable to set static ip on "bridged" network

Posted: 2019/06/05 11:07:09
by thewall83
The correct gateway is 10.5.21.251.
I'm sorry, the outputs have been taken after a wrong configuration that I made.
I just launched again the commands and the result is the same except for 251 vs 151.

I still can't ping machines within 10.5.20.0/23.

VMware host get its static IP address with manual configuration.