Sponsored Content
Top Forums Programming Set host default gateway in C program. Post 302445855 by semash! on Tuesday 17th of August 2010 04:16:28 AM
Old 08-17-2010
Set host default gateway in C program.

Hello everybody,
I'm having troubles on setting the default gateway address (and other addresses, such as netmask, or ip) of the host running a C program. I know it has to be with ioctl, but don't know how to do it.

Could somebody give me an example on how to set the default gateway address of a determinated device from the C program?

Any comment will be of help,
Thanks.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to end a host concurrent program in WARNING?

Hi, I want to end a host (shell script based) concurrent program in WARNING. Is it possible? Tried out a few things but it just either ends in NORMAL or ERROR. :confused: Any ideas/inputs would be appreciated. Thanks, coolblue_3 (2 Replies)
Discussion started by: coolblue_3
2 Replies

2. UNIX and Linux Applications

set mysql password with host parameter

hi, linux gurus... i'm trying to write a script in ksh called ResetPass that allows a user to change mysql passwords. the script accepts user, password and host like this: ResetPass <user> <password> <host>. here's the code: ***************************************************** mysql... (1 Reply)
Discussion started by: ankimo
1 Replies

3. Shell Programming and Scripting

Kill shell script when host program not running/disk unmounted

I have my Mac OS X program executing a shell script (a script that copies files to a drive). I want to make it so that the shell script automatically kills itself if it finds that the host .app is not running OR kill itself if the drive that it is copying files to has been unmounted. Right now what... (2 Replies)
Discussion started by: pcwiz
2 Replies

4. Programming

How to read max stack size -Xss that is set/default for a java program?

I need to know what is the maximum stack size i.e. -Xss my java program is running with. Is there a way to find that out from inside my java program code and outside of it. What i am looking for is to read whatever the current set max limit -Xss (stack sie) is for a particular JVM(not... (3 Replies)
Discussion started by: mohtashims
3 Replies

5. Solaris

How to set gateway address to a particular interface?

How to set gateway address to a particular interface? waht are the files need to update to make it permanent? (2 Replies)
Discussion started by: Naveen.6025
2 Replies

6. Shell Programming and Scripting

Set variable to path that does not exist on local host

Can anyone suggest a workaround zone_5.org='/qaz/qwe/path/tns.osn' output /home/bingo/XXX_script.sh: line 180: zone_5.org=/qaz/qwe/path/tns.osn: no parent The path does not exist on the local machine, the allocation used to work till the server was upgraded. Red Hat Enterprise Linux... (2 Replies)
Discussion started by: squrcles
2 Replies

7. Red Hat

Create an unconfigured VMware host from a template that is set to do firstboot --reconfig

I have an Oracle Linux 7.1 vsphere host built. It's be preconfigured with our security configurations. What I would like to do is unconfigure this host. Then set the host to do firstboot --reconfigure. how do I do that using /etc/sysconfig/firstboot? I've tried setting ... (10 Replies)
Discussion started by: os2mac
10 Replies

8. Shell Programming and Scripting

How to end a host concurrent program in WARNING status?

Hi All, I have a requirement to make a oracle concurrent program end with warning based on a given condition. If the condition is true, the concurrent program should end with completed warning status. The host program I am using is a shell script that checks if a file exists. ... (2 Replies)
Discussion started by: megha2525
2 Replies

9. Red Hat

Set new gateway for route to internet

Hi all, i have a rhel 6.2 with a default gateway. This server is an Intranet office with no internet access. DNS are already configured and it's possible to resolve my target. My goal is to link my application (apache forward) only to http://mytarget.yyy through a new gateway (That does... (0 Replies)
Discussion started by: kamose
0 Replies

10. UNIX for Beginners Questions & Answers

Inconsistency between RedHat 6.5 global gateway and single gateway leads to loss of default gateway

Dear friends I use RedHat 6.5, which sets the gateway in the configuration file / etc / sysconfig / network as GATEWAY = 192.168.1.26, and the gateway in the configuration file / etc / sysconfig / network-scripts / ifcfg-eth11 as GATEWAY = 192.168.1.256. The two gateways are different.... (6 Replies)
Discussion started by: tanpeng
6 Replies
HTABLE(8)						      System Manager's Manual							 HTABLE(8)

NAME
htable - convert NIC standard format host tables SYNOPSIS
/etc/htable [ -c connected-nets ] [ -l local-nets ] file DESCRIPTION
Htable is used to convert host files in the format specified in Internet RFC 810 to the format used by the network library routines. Three files are created as a result of running htable: hosts, networks, and gateways. The hosts file may be used by the gethostbyname(3N) rou- tines in mapping host names to addresses if the nameserver, named(8), is not used. The networks file is used by the getnetent(3N) routines in mapping network names to numbers. The gateways file may be used by the routing daemon in identifying ``passive'' Internet gateways; see routed(8C) for an explanation. If any of the files localhosts, localnetworks, or localgateways are present in the current directory, the file's contents is prepended to the output file. Of these, only the gateways file is interpreted. This allows sites to maintain local aliases and entries which are not normally present in the master database. Only one gateway to each network will be placed in the gateways file; a gateway listed in the localgateways file will override any in the input file. If the gateways file is to be used, a list of networks to which the host is directly connected is specified with the -c flag. The net- works, separated by commas, may be given by name or in Internet-standard dot notation, e.g. -c arpanet,128.32,local-ether-net. Htable only includes gateways which are directly connected to one of the networks specified, or which can be reached from another gateway on a connected net. If the -l option is given with a list of networks (in the same format as for -c), these networks will be treated as ``local,'' and informa- tion about hosts on local networks is taken only from the localhosts file. Entries for local hosts from the main database will be omitted. This allows the localhosts file to completely override any entries in the input file. Htable is best used in conjunction with the gettable(8C) program which retrieves the NIC database from a host. SEE ALSO
intro(3N), gettable(8C), named(8) BUGS
If the name-domain system provided network name mapping well as host name mapping, htable would no longer be needed. 4.2 Berkeley Distribution May 22, 1986 HTABLE(8)
All times are GMT -4. The time now is 07:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy