I am starting a sub-interface off of my existing eth0, and its supposed to be an instant thing, so I'm trying to avoid using a config file. When I issue:

ifconfig eth0:1 up

The interface comes up, and works, but my DNS resolution is lost, and I can't ping anything even say www.google.com, yet I could before the interface was brought up. The configuration for the initial interface is:

[root@server-1 network-scripts]# cat ifcfg-eth0

Am I not able to resolve DNS names after I start the sub-interface because they're on the same network?

This is the output of ip addr show

$ ip addr list

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 00:50:56:97:0c:06 brd ff:ff:ff:ff:ff:ff
    inet brd scope global eth0
    inet brd scope global eth0:2
    inet brd scope global eth0:3
    inet6 fe80::250:56ff:fe97:c06/64 scope link
       valid_lft forever preferred_lft forever
  • Look at the routing table, befote and after. My guess is that your neglegting to include a mask is trashing your routes. – Zoredache Sep 12 '13 at 15:24
  • I might have just solved this issue as well as my other one, I'm testing some more, I will post my answer in a bit. – FilBot3 Sep 12 '13 at 16:07
  • 1
    BTW, you really should avoid using ifconfig and start learning how to use ip instead. The equivalent command would be ip addr add dev eth0. – Zoredache Sep 12 '13 at 16:30
  • What's the added benefit of using that? – FilBot3 Sep 13 '13 at 13:41
  • I used the ip addr add 192.168.02/24 dev eth0 command, and now the ip address is not showing, nor can I use ifconfig eth0:1 netmask up command. Tells me: SIOCGIFADDR: Cannot assign requested address SIOCSIFBROADCAST: Cannot assign requested address SIOCSIFFLAGS: Cannot assign requested address and then when i use the command you suggested with up it tells me its garbage. How do I remove the file now since RTNETLINK answers: File exists – FilBot3 Sep 13 '13 at 16:18

Turns out, in relation to this post, the answer I got that helped fix that issue, also fixed this issue. Instead of just issuing:

ifconfig eth0:1 up

I issued the command with a netmask at the end:

ifconfig eth0:1 netmask up

and it worked. I can ping any DNS name, traceroute and all that jazz.

  • However, now that I have the ability to ping FQDN names, I cannot access my website provided by the IP I am bringing up. – FilBot3 Sep 16 '13 at 16:05
  • Turns out that there were multiple machines on my network with that same IP, just no FQDN with them. Someone who is running my network is not properly maintaining it. – FilBot3 Sep 20 '13 at 13:08

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.