Page 1 of 1

Centos 6.5 NAT dhcp + Host Only Adapter static = no internet

Posted: 19. Aug 2014, 14:34
by mad.kitty
I've got "Centos 6.5 x86_64 minimal" fresh install on Win7 host.

Adapter1->NAT->eth0->dhcp
Adapter2->Host Only Adapter->eth1->dhcp

Everything works fine here. But when I change eth1 to static, NAT can not access internet. What am I doing wrong?
Here's my settings.

Code: Select all

[root@centos ~]# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 08:00:27:FB:48:A7  
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fefb:48a7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:590 (590.0 b)  TX bytes:894 (894.0 b)

Code: Select all

[root@centos ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=08:00:27:FB:48:A7
TYPE=Ethernet
UUID=3cff828d-59e4-4e75-8e61-f9db5cccb616
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=dhcp

Code: Select all

[root@centos ~]# ifconfig eth1
eth1      Link encap:Ethernet  HWaddr 08:00:27:23:64:B7  
          inet addr:192.168.56.110  Bcast:192.168.56.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe23:64b7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:224 errors:0 dropped:0 overruns:0 frame:0
          TX packets:192 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:20808 (20.3 KiB)  TX bytes:33938 (33.1 KiB)

Code: Select all

[root@centos ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
HWADDR=08:00:27:23:64:B7
TYPE=Ethernet
UUID=30c8e5b2-66ea-440d-ba28-d3ff97cd5532
ONBOOT=yes
NM_CONTROLLED=no
#BOOTPROTO=dhcp
BOOTPROTO=static
IPADDR=192.168.56.110
NETMASK=255.255.255.0
GATEWAY=192.168.56.1

Code: Select all

[root@centos ~]# ping google_dot_com
ping: unknown host google_dot_com

[root@centos ~]# ping -c 4 10.0.2.2
PING 10.0.2.2 (10.0.2.2) 56(84) bytes of data.
64 bytes from 10.0.2.2: icmp_seq=1 ttl=63 time=0.735 ms
64 bytes from 10.0.2.2: icmp_seq=2 ttl=63 time=0.167 ms
64 bytes from 10.0.2.2: icmp_seq=3 ttl=63 time=0.165 ms
64 bytes from 10.0.2.2: icmp_seq=4 ttl=63 time=0.171 ms
Thank you!

Re: Centos 6.5 NAT dhcp + Host Only Adapter static = no inte

Posted: 19. Aug 2014, 15:06
by Perryg
There is no gateway for a host-only connection as it is just that, host-only and no Internet.
Adding one will change the dynamic of the segment and cause it to fail.

Re: Centos 6.5 NAT dhcp + Host Only Adapter static = no inte

Posted: 19. Aug 2014, 15:24
by mad.kitty
Perryg wrote:There is no gateway for a host-only connection as it is just that, host-only and no Internet.
Adding one will change the dynamic of the segment and cause it to fail.
Thank you very much! Now it's working fine without gateway.