cancel
Showing results for 
Search instead for 
Did you mean: 
mike_cc
Level 7

Change IP Address Using CLI?

Jump to solution

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

0 Kudos
1 Solution

Accepted Solutions
trishoar
Level 11

Re: Change IP Address Using CLI?

Jump to solution

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

0 Kudos
6 Replies
trishoar
Level 11

Re: Change IP Address Using CLI?

Jump to solution

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

0 Kudos
mike_cc
Level 7

Re: Change IP Address Using CLI?

Jump to solution

That works. I was able to get an ip on the system configuring ifcfg-eth0. I then used the UI to enter the network config so it would remain after a reboot.

Mike

0 Kudos
McAfee Employee

Re: Change IP Address Using CLI?

Jump to solution

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

0 Kudos
mike_cc
Level 7

Re: Change IP Address Using CLI?

Jump to solution

Right, that's what I said here "I then used the UI to enter the network config so it would remain after a reboot."

0 Kudos
McAfee Employee

Re: Change IP Address Using CLI?

Jump to solution

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
Level 9

Re: Change IP Address Using CLI?

Jump to solution

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).

0 Kudos