I have two NIC configured on VM's one IP is assign by DHCP on 172.26.43.XX VLAN and 10.10.10.XX is static ip I am installing cloudera beta 5 on these VM, while detecting the host cloudera is returning back with the 172 VLAN IP of all the hosts but i need cloudera to communicate on 10 VLAN (it have gateway and entry on dns server)

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         UG    100    0        0 eth0      *        U     0      0        0 eth1     *        U     0      0        0 eth0

hosts file on all the host have only entry of the 10.10.10.XX IP corresponding to hostname.

IP of one of the host is

output of commands are below

ip route
default via dev eth0  metric 100 dev eth1  proto kernel  scope link  src dev eth0  proto kernel  scope link  src

ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:a4:dd:27 brd ff:ff:ff:ff:ff:ff
    inet brd scope global eth0
    inet6 fe80::a00:27ff:fea4:dd27/64 scope link
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:1d:27:83 brd ff:ff:ff:ff:ff:ff
    inet brd scope global eth1
    inet6 fe80::a00:27ff:fe1d:2783/64 scope link
       valid_lft forever preferred_lft forever
  • 2
    define primary IP... this doesn't exist as a weel known concept (at leat not one known to me). your host should use as source IP whichever is set on the outpointing interface used to reach its destination. this is of course all based on your routing table. you may be miss-enunciating your needs. please clarify. – alxgomz Jan 24 '14 at 7:17
  • there is no primary interface. There is one bound to your host name and the one which has default route. It may be the same interface. So the question from @alxgomz is absolutely valid: define primary IP. – kofemann Jan 24 '14 at 7:21
  • Apologies for ambiguous terminologies please have a look to updated question. – Vikas Hardia Jan 24 '14 at 9:58

"primary IP" is an alias for "whatever your system uses when it originates traffic to the default route". In the absence of source phrases on that route, that's the first address of the interface used (more or less).

So if your address on eth1 is, first find out which address the router on that interface has (either with dhclient or by asking your sysadmin -- let's assume that the answer is, then do

    ip route change default via dev eth1

Add src to the end if your system has more than one address on that interface.

NB: you might want to use ip route instead of route. Different syntax, but way more features.

  • not able to run the command getting response RTNETLINK answers: No such file or directory – Vikas Hardia Jan 24 '14 at 10:35
  • It should work. Please add the output of ip addr and ip route to your question. – Matthias Urlichs Jan 24 '14 at 10:57
  • I have update the question please have a look – Vikas Hardia Jan 24 '14 at 11:26
  • Hmm. ip route change default via dev eth1 definitely should work, given your interfaces. – Matthias Urlichs Jan 24 '14 at 11:29
  • 1
    getting the same error :( please see the command >>>ip route change default via dev eth1 output >>> RTNETLINK answers: Operation not permitted – Vikas Hardia Jan 24 '14 at 12:30

this cloudera thing probably relies on hostname resolution. check that the hostname of your host points to the IP 10.x.x.x. for instance, on a debian like system you should check that the hostname configured in /etc/hostname maps to the 10.x.x.x IP in /etc/hosts.

  • my hostname file have entry of 10.X.X.X IP of all the hosts. – Vikas Hardia Jan 27 '14 at 6:59
  • What does the following command returns?: ping -c 1 $(hostname) – alxgomz Jan 27 '14 at 7:31
  • PING cdh4hbm.is.co.in ( 56(84) bytes of data. 64 bytes from icmp_req=1 ttl=64 time=1.13 ms --- cdh4hbm.is.co.in ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 1.139/1.139/1.139/0.000 ms – Vikas Hardia Jan 27 '14 at 11:43
  • does your /etc/hosts file really contains an entry 10.x.x.x for cdh4hbm.is.co.in? if So check tout /etc/nsswitch.conf – alxgomz Jan 27 '14 at 19:26
  • 1
    there is NO line with : 10.X.X.X cdh4hbm.is.co.in !!! You only have one with cdh4hbm (without the domain). For some reason you hostname in /etc/hostname is probably fqdn. either fix your /etc/hostname to contain non-fqdn name (as per man hostname), or add cdh4hbm.is.co.in in /etc/hosts. That should do the trick – alxgomz Jan 28 '14 at 22:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.