Skip navigation
McAfee Secure sites help keep you safe from identity theft, credit card fraud, spyware, spam, viruses and online scams
1462 Views 6 Replies Latest reply: Jan 29, 2014 9:33 AM by phlrnnr RSS
mike_cc Newcomer 19 posts since
Oct 15, 2012
Currently Being Moderated

Dec 11, 2012 9:28 AM

Change IP Address Using CLI?

I want to change the ip address of my MWG v7 appliance using the CLI - how do I do this? The ifcfg-eth0 script doesn't have the interface information in it, so I'm not sure where the interface is getting it's IP information from. This interface is the web interface.

 

Thanks,

Mike

  • trishoar Apprentice 61 posts since
    Jan 28, 2010
    Currently Being Moderated
    1. Dec 11, 2012 11:16 AM (in response to mike_cc)
    Re: Change IP Address Using CLI?

    Hi Mike,

     

    On my server they are in  /etc/sysconfig/network-scripts/ifcfg-eth0

    and changing it there and issuesing a service network reload will work.

    Likewise you can use

    ip a add 0.0.0.0/0 dev eth0

    to add, change and remove them. however I would recomend against doing this as when you reboot MWG will change all the settings back again. I'm sure you can make it persistant if you try, but unless there is an overiding reason why you would want this long term rather than to just suffle things in the backround whilst you do something I'd use the UI.

     

    Tris

  • Jon Scholten McAfee SME 857 posts since
    Nov 3, 2009
    Currently Being Moderated
    3. Dec 11, 2012 3:14 PM (in response to mike_cc)
    Re: Change IP Address Using CLI?

    By modifying the system directly you are not allowing the MWG software to write it into its own files.

     

    This may cause issues when attempting to restore a backup or during the upgrade process.

     

    You will want to set the IP in the interface to be certain the changes are set everywhere.

     

    Best,

    Jon

  • Jon Scholten McAfee SME 857 posts since
    Nov 3, 2009
    Currently Being Moderated
    5. Dec 11, 2012 5:18 PM (in response to mike_cc)
    Re: Change IP Address Using CLI?

    Sorry Mike,

     

    derr on my part. I read that wrong....

     

    Tris' commands should work, I use ifconfig:

    # Temporarily configure IP address (will not persist through reboot)

    ifconfig eth0 <desired IP> netmask 255.255.0.0

     

    You may also want to set the default gateway sometimes, to do this you can use the following, this will temporarliy set it as well:

    ip route add default via <default-gw-ip>

     

    Best,

    Jon

  • phlrnnr Newcomer 24 posts since
    Jul 13, 2011
    Currently Being Moderated
    6. Jan 29, 2014 9:33 AM (in response to Jon Scholten)
    Re: Change IP Address Using CLI?

    Thanks @Jon_Scholten!  This is very helpful when accidentally breaking the network settings (I changed the IP in the UI, but forgot to change the default GW, so the only way I could reach the appliance was by the console).

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • Correct Answers - 5 points
  • Helpful Answers - 3 points