Sponsored Content
Operating Systems Linux Debian How do i correct restart network-services in Debian? Post 303034383 by int3g3r on Wednesday 24th of April 2019 10:00:40 AM
Old 04-24-2019
How do i correct restart network-services in Debian?

Hello,


I would like to do follow steps.
  • Set a static IP-Adress on eth0 (For Testing)
  • Set DHCP on eth0
  • All steps should be done without a single reboot.




/etc/network/interfaces
Code:
  
   iface eth0 inet static
   address 192.0.2.7/24
   gateway 192.0.2.254

How do i perform the windows command "ipconfig /renew" on Debian ?

If i use "systemctl networking restart" -> "ip a" static ip doesnt show up
If i use "ifup eth0" -> "ip a" shows the correct ip address, why is this needed ? I never deactivated my interface eth0. This makes no sense to me i restartet the complete network service before.
What is the correct way to restart the network service ?

/etc/network/interfaces
Code:
  
   iface eth0 inet dhcp

How can i ask for a new ip form dhcp (what is the command)?
Do i need the "ifup eth0" here again ?


Regards,
Integer
 

8 More Discussions You Might Find Interesting

1. BSD

restart the network on freeBSD 7.2

hi howto restart the network with a wireless interface including wpa_supplicant on freeBSD 7.2 without reboot? (3 Replies)
Discussion started by: ccc
3 Replies

2. AIX

How restart the network interface in AIX?

Hi All, Please let me know the command to restart the network interface and enable it on boot in AIX, similar to /etc/init.d/network restart in Redhat. Thanks, Sunil.K please watch out to post in the right subforum! (9 Replies)
Discussion started by: sunilrk07
9 Replies

3. UNIX for Advanced & Expert Users

Opinion on auto-restart of failed apps/services

I'm becoming a dying breed where I work. More and more sys admins are advocating automatically restarting failed services such as tomcat, jboss, etc. I've always been against doing this except with buggy apps that can't be fixed or avoided. My main argument is that I feel it's a trick used by... (9 Replies)
Discussion started by: mglenney
9 Replies

4. AIX

problem to restart services from /etc/inittab in AIX6.1

hello, i have an AIX6.1.7.2 machine that it was upgraded recently from AIX5.3.9.4. when i kill system services that should restart automatically like /usr/sbin/cron it doesnt start. i checked my /etc/inittab file and i confirmed that this service is in respawn status so when i kill this process... (2 Replies)
Discussion started by: omonoiatis9
2 Replies

5. Shell Programming and Scripting

Need script to restart the services

Hi Guys, I need bash script to restart the service. 1. Disable the service called SASM svcadm disable sasm 2. if service went to maintenance mode then it shuld clear it with below command svcadm clear sasm 3.or else it should restart the mysql service /etc/init.d/mysql stop... (1 Reply)
Discussion started by: bapu1981
1 Replies

6. Shell Programming and Scripting

Restart debian server if one specific process has more than 10 seconds have high cpu load

Hi, could someone give me an example for a debian server script? I need to check a process if the process has a high cpu load (top). If yes the whole server needs to reboot. Thats it, nothing more. ;) Hope someone could help me. Regards woisch (2 Replies)
Discussion started by: woisch
2 Replies

7. Red Hat

Restart of services if port no is changed in /etc/services in RHEL

I had a doubt if any services need to be restarted if port no in /etc/services in an RHEL setup is changed. For eg, the port no of 443 for SSL may need to be changed. I hope my query is clear whether any services need to be restarted if port no in /etc/services is changed. Please revert with... (10 Replies)
Discussion started by: RHCE
10 Replies

8. Red Hat

Network becomes slow and return fast only after restart network

Hi, I have 2 machines in production environment: 1. redhat machine for application 2. DB machine (oracle) The application doing a lot of small read&writes from and to the DB machine. The problem is that after some few hours the network from the application to the DB becomes very slow and... (4 Replies)
Discussion started by: moshesa
4 Replies
ifup(8) 																   ifup(8)

NAME
ifup - bring a network interface up ifdown - take a network interface down SYNOPSIS
ifup [-nv] [--no-act] [--verbose] [-i FILE|--interfaces=FILE] [--allow CLASS] -a|IFACE... ifup -h|--help ifup -V|--version ifdown [-nv] [--no-act] [--verbose] [-i FILE|--interfaces=FILE] [--allow CLASS] -a|IFACE... DESCRIPTION
The ifup and ifdown commands may be used to configure (or, respectively, deconfigure) network interfaces based on interface definitions in the file /etc/network/interfaces. OPTIONS
A summary of options is included below. -a, --all If given to ifup, affect all interfaces marked auto. Interfaces are brought up in the order in which they are defined in /etc/net- work/interfaces. If given to ifdown, affect all defined interfaces. Interfaces are brought down in the order in which they are currently listed in the state file. Only interfaces defined in /etc/network/interfaces will be brought down. --force Force configuration or deconfiguration of the interface. -h, --help Show summary of options. --allow=CLASS Only allow interfaces listed in an allow-CLASS line in /etc/network/interfaces to be acted upon. -i FILE, --interfaces=FILE Read interface definitions from FILE instead of from /etc/network/interfaces. -e PATTERN, --exclude=PATTERN Exclude interfaces from the list of interfaces to operate on by the PATTERN. Notice that the PATTERN can be a full interface name or substrings that match interfaces. Users could easily have unexpected behaviour if they use a small string to do the match. -n, --no-act Don't configure any interfaces or run any "up" or "down" commands. --no-mappings Don't run any mappings. See interfaces(5) for more information about the mapping feature. -V, --version Show copyright and version information. -v, --verbose Show commands as they are executed. EXAMPLES
ifup -a Bring up all the interfaces defined with auto in /etc/network/interfaces ifup eth0 Bring up interface eth0 ifup eth0=home Bring up interface eth0 as logical interface home ifdown -a Bring down all interfaces that are currently up. NOTES
ifup and ifdown are actually the same program called by different names. The program does not configure network interfaces directly; it runs low level utilities such as ip to do its dirty work. FILES
/etc/network/interfaces definitions of network interfaces See interfaces(5) for more information. /var/run/network/ifstate current state of network interfaces KNOWN BUGS
/LIMITATIONS The program keeps records of whether network interfaces are up or down. Under exceptional circumstances these records can become inconsis- tent with the real states of the interfaces. For example, an interface that was brought up using ifup and later deconfigured using ifcon- fig will still be recorded as up. To fix this you can use the --force option to force ifup or ifdown to run configuration or deconfigura- tion commands despite what it considers the current state of the interface to be. The file /var/run/network/ifstate must be writable for ifup or ifdown to work properly. On Ubuntu the /var/run location is a temporary filesystem which is always writable and thrown away on shutdown. You can also use the --force option to run configuration or deconfigura- tion commands without updating the file. Note that the program does not run automatically: ifup alone does not bring up interfaces that appear as a result of hardware being installed and ifdown alone does not bring down interfaces that disappear as a result of hardware being removed. To automate the configura- tion of network interfaces you need to install other packages such as hotplug(8) or ifplugd(8). AUTHOR
The ifupdown suite was written by Anthony Towns <aj@azure.humbug.org.au>. SEE ALSO
interfaces(5), ip(8), ifconfig(8). IFUPDOWN
22 May 2004 ifup(8)
All times are GMT -4. The time now is 08:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy