Programming :: Set Gateway Using C++?

Nov 26, 2010

I'm trying to set the gateway with my c++ program. My function receive the gateway on the first parameter.

The return of execution of ioctl() is 0, so it's working good, but when I run the "route" command on console, the configured gateway isn't there.

Check the output and the function below:

$ route
Quote:
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.0 * 255.0.0.0 U 0 0 0 eth0

[Code].....

View 3 Replies


ADVERTISEMENT

Programming :: How To Get Gateway Address

Nov 18, 2010

you know ,we can get a Iface's MAC Address,IP Address,NetMask by function ioctl(), But how Can I get a Iface's Gateway by ioctl or other funciton!

View 5 Replies View Related

Programming :: Delete The Default Gateway Via NETLINK Kernel API?

Apr 15, 2010

I am looking for a way to delete the systems default gateway from the routing table via the NETLINK API.Unfortunately, the documentation I found about NETLINK is incomplete.There are some basics (communicating with the kernel, reading the routing table) but not much more.Does anyone know the packet format for deleting a routing table entry, especially deleting the default gateway? I can set or change the default gateway with the following parameters (there are more, but I left out all the non-essential ones):

NL-Msg Header:
nlmsg_flags = NLM_F_REQUEST | NLM_F_CREATE;
nlmsg_type = RTM_NEWROUTE;

[code]....

View 1 Replies View Related

General :: Cannot Add Default Gateway

Aug 10, 2010

Getting the following error when trying to add a default gateway for eth1.

# route add default gw 192.168.228.2 eth1
route: SIOCADDRT: Network is unreachable

View 2 Replies View Related

Ubuntu :: Connecting To MS-RDS Via SSL Gateway?

Dec 21, 2010

I use Ubuntu 10.10 x64 at home. My company uses Microsoft RDS (remote desktop services, aka terminal services) at work and I'd like to know if it's possible to connect from home.

On a Windows machine, there is an extra tab in the remote desktop client that allows you to specify a secure gateway to connect through - this means you don't need to establish a VPN connection beforehand, it simply just connects straight away via an SSL tunnel.

I've looked at quite a few Ubuntu RDP clients and none of them seem to have this option.

Does anyone know if it can be done? Either that or I'd like to get my hands on a copy of the 64 bit linux Cisco VPN client that works. I've found a few copies around the internet but they always fail to install.

View 1 Replies View Related

Networking :: Defining Two Gateway With Different IPs

Aug 2, 2009

I have a server with 192.1.9.10 ip address and I want to define two gateways with ip: 192.1.9.4 and 192.1.9.254 on it but I don't know how I can do it. I don't have professional information in linux.

View 1 Replies View Related

Networking :: Gateway In Other Subnet

Jan 1, 2011

I've rent a server from a Germany data center,They use a single IP as their gateway that is not in range of my servers IP,Strangly server is working well and when I use 'route -n' command the gateway which is in other subnet appears properly./etc/sysconfig/network contains no gateway IP and I don't know how they set the default gateway while after reboot the gateway is the same, also the IP is static and there's now DHCP.I need to know how they did it so I can do the same on my VPSes.

View 1 Replies View Related

Networking :: How To Add Gateway (Static IP)

Jul 12, 2011

I have 2 lancard eth0 connected to local lan eth1 connected to bsnl broadband connection, I have centos 5.3 here I configure broadband in dial up mode. I am unable to ping outside world and unable to access some site but able to access internet like google etc, configure file is as:

eth0 Link encap:Ethernet HWaddr 00:14:85:96:1C:A7
inet addr:182.x.x.24 Bcast:1182.16.255.255 Mask:255.255.0.0
inet6 addr: fe80::214:85ff:fe96:1ca7/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:736487 errors:0 dropped:0 overruns:0 frame:0
TX packets:859918 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:122617961 (116.9 MiB) TX bytes:772581200 (736.7 MiB)
Interrupt:185 Base address:0x6000

eth1 Link encap:Ethernet HWaddr 00:08:A1:7B:A0:F9
inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::208:a1ff:fe7b:a0f9/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:658246 errors:0 dropped:0 overruns:0 frame:0
TX packets:620456 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:728744445 (694.9 MiB) TX bytes:100768525 (96.1 MiB)
Interrupt:193 Base address:0x4000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:21198 errors:0 dropped:0 overruns:0 frame:0
TX packets:21198 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:5867015 (5.5 MiB) TX bytes:5867015 (5.5 MiB)

ppp0 Link encap:Point-to-Point Protocol
inet addr:59.xx.xx.xx P-t-P:59.xx.xx.1 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1460 Metric:1
RX packets:793 errors:0 dropped:0 overruns:0 frame:0
TX packets:968 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:528818 (516.4 KiB) TX bytes:148274 (144.7 KiB)

[root@venus ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
59.xx.xx.1 * 255.255.255.255 UH 0 0 0 ppp0
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
169.254.0.0 * 255.255.0.0 U 0 0 0 eth1
182.xx.0.0 * 255.255.0.0 U 0 0 0 eth0
default * 0.0.0.0 U 0 0 0 ppp0

I am unable to ping gateway of ISP IP i.e gateway of static IP.

View 1 Replies View Related

Networking :: Cannot Connect PC As Gateway Using One NIC

Sep 9, 2010

I have one scenerio ,I want to use my Linux PC as residential gateway .I have only one NIC connected to my PC(I cannot connect more) to handle this problem I am using switch . All the devices including my PC are connected using switch (Please refer attached file). I am not sure how can I achieve this ? I am familiar with NAT and DHCP but do not know is this possible in this case?

View 11 Replies View Related

Server :: Error: 502 Bad Gateway?

Nov 15, 2010

we have a problem in accessing the site hosted on our web server from today.Till yesterday it worked fine. But when tried to access through domain name this morning it throws bad gateway error."The proxy server received an invalid response from an upstream server". this is the error i am getting.But it can be accessed fine using the ipaddress.All my dns entries are right.

View 2 Replies View Related

Red Hat :: Set Default Gateway - Which File ?

May 28, 2010

I want to set default gateway permanently. There are two files and both have keyword "gateway":

Code:

View 2 Replies View Related

OpenSUSE :: 11.3 (i586) No Gateway With Networkmanager

Jul 27, 2010

I did an upgrade from 11.2 to 11.3 at my Dell D820 laptop. Everything is working fine except that with Networkmanager it no longer sets the default gateway received by DHCP. I do receive an IP-adress (wired/wireless, does not make a difference) but no gateway. I have tested with several networks and this problem stays...

Of course I can do it manual (adding an default gw), but facing different wired/wireless networks its very unhandy.

Under Networkmanager -> Manage Connection You can edit a connection. If you do that, under tab 'IP-address' -> Configure: Automatic (DHCP) . Below you can select option 'routes'. In this field nothing is selected (I think that is correct). It must be something simple/stupid but what?

OS: Linux 2.6.34-12-desktop i686
KDE: 4.4.4 "release 2
CPU: T2400 @ 1.83 Ghz

View 2 Replies View Related

Ubuntu Networking :: Trying To Fix Up A Gateway Computer?

Jan 2, 2010

I have a gateway computer that I've been trying to fix up - whenever I try to install Windows XP/2000/Ubuntu, it finds a bunch of errors. I'd really like to get this computer working, it has a 300GB HD, TV inputs, USB ports out the wazoo, and all that other good stuff. Can someone help me with what to do or have a suggestion on what to replace?

I have formatted the hard drive (the Windows installation did it.) The windows installation is to the point where its copying the installation files to the disk, then it gives me an error that it can't find/can't copy the file. The Linux installation just gives me cryptic errors before it even does anything.

I just want to get it to a point where it's usable I really don't care what operating system.

View 1 Replies View Related

Ubuntu Networking :: FTP Is Not Working Through A Gateway?

Jan 26, 2010

FTP is not working through a gateway and I think I found that I need to modprobe ip_masq_ftp. However, when I do try to load ip_masq_ftp I get the error: FATAL: Module ip_masq_ftp.o not found.My question is: how do I get ip_masq_ftp?More questions: Do I have to build a new kernel? If I do need to build a new kernel do I just include the ip_masq_ftp module or are there other modules that I need?

View 1 Replies View Related

Ubuntu Networking :: Gateway With 2 Red Networks?

Jun 21, 2010

What i need to do is setup a gateway with 2 red networks, reason being 1 is my internet connection and the other is my bDSL connection for our IP phone system and i need an IP range of traffic routed to the bDSL rather than internet, i can do this on individual PC's but id like to do it at the firewall level so i dont have to configure each machine on the network.

basically i want all traffic to go to internet except for say 203.x.x.x which i want routed to the bDSL router and let it handle it. Ive dome some reading and it seems ipcop and smoothwall cant do it so i was hoping with some tricky work maybe i can get ubuntu to do it for me.

View 2 Replies View Related

Ubuntu Installation :: Cannot Install 10.4 On Gateway PC

Jul 28, 2010

I am having trouble installing ubuntu on a new to me gateway computer. The spec's are as thus: Intel Celeron Cpu 2.4GHz, 1.25 GB DDR RAM, 250 GB ATA 5200rpm HD. I have tried installing Ubuntu 10.4, Ubuntu 9.10, Xubuntu 10.4 and Lubuntu 10.4. Neither Ubuntu 10.4 or 9.10 would boot from live cd and after full install would freeze on the loading 5 dot screen with no messages. Xubuntu would freeze sooner.

Lubuntu would go live but after a full install would come up with this error, "(process:219): GLib-WARNING **: getpwuid_r(): failed due to unknown user id". All of the cd's work fine on my laptop and I have checked them for defects. I have tried safe graphics mode a changing around a few options. So I was wondering if this computer just won't take Ubuntu or is there a work-around on the command line? I've only been working with Ubuntu for about 6 months.

View 2 Replies View Related

Ubuntu Networking :: Cannot Ping The Gateway

Feb 12, 2011

I can ping my IP, and other PC in the same LAN, but I CANNOT ping the gateway on my 10.04LTS ubuntu. Other PC in the same LAN(Ubuntu 10.04LTS) could ping the gateway and my IP. I thought that (1)network cable is OK because I could ping the other PC in the same LAN.(2)Gateway is OK because other PC could ping it. (3)setting of operating system might be somehow wrong.

I have tried to restart the network several times and still not works. I followed the HOW-To debug tips and following is the results. Any suggestions?

1. ifconfig
eth2 Link encap:Ethernet HWaddr 00:1d:7d:aa:d5:d3
inet addr:140.112.61.75 Bcast:140.112.61.255 Mask:255.255.255.0
inet6 addr: fe80::21d:7dff:feaa:d5d3/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

[code]....

View 2 Replies View Related

Networking :: Gateway Changing Hostname?

Mar 14, 2010

I am coming across a strange error with my gateway. When I do a "ping", this is what I get below:k-63a5b848c6cb4:~ # ping simba PING simba.gateway.2wire.net (192.168.1.69) 56(84) bytes of data.

64 bytes from k-63a5b848c6cb4 (192.168.1.69): icmp_seq=1 ttl=64 time=0.041 ms
64 bytes from k-63a5b848c6cb4 (192.168.1.69): icmp_seq=2 ttl=64 time=0.029 ms
64 bytes from k-63a5b848c6cb4 (192.168.1.69): icmp_seq=3 ttl=64 time=0.023 ms

[code]....

View 1 Replies View Related

Networking :: Routing One Gateway To Different Subnets ?

Sep 3, 2010

Im having a issue with routing internet traffic from my router two different subnets (vlans).

Theres my setup:-

Server:

Both eth0,1 are running dhcp (two scoopes) that works fine!

The output of route -n is:

I have ip_forwarding on aswell, but i can ping the ip on the server running that dhcp scoope ie ping 192.168.4.1 works great but i just cant get the internet on the clients.

View 8 Replies View Related

Ubuntu :: Gateway SX2800 Won't Load / What To Do?

Oct 8, 2010

I recently purchased a Gateway SX2800, Intel Q8200 quad processor, 4 GB DDR3, with built in GMA X4500 graphics. It works fine with the Vista that came with it (at least as fine as Vista works), but I have tried live cd's of 18 distro's, and only 5 will load (not ones I particularly like). I prefer Ubuntu, and it starts to load, gives the Ubuntu splash screen, then after a few minutes goes to a black screen. One of the non *buntu flavors I tried to load got to that point and showed a color band with the error message "Signal out of range". In searching this, the GMA X4500 graphics is listed as working with linux, and several posters on different websites talk about the SX2800 working with Ubuntu.

View 9 Replies View Related

General :: Setting Up A Sms Gateway Using An Old Phone?

Jun 4, 2010

I'm thinking of setting up my own sms gateway using my own linux server and regular old nokia phone, along the lines of what is described here [URL]

I was wondering if anyone out there has been down this road before, and in particular knows about approximately how many messages could be sent/received per minute? In the application I have in mind (an instantaneous online survey from an audience of hundreds) I would need to be receiving hundreds of sms texts in around a minute. I was wondering if that was pushing it in terms of the capabilities of an old phone.

View 4 Replies View Related

Hardware :: Installing On Gateway NV5214u ?

Apr 27, 2010

I have just purchased a Gateway NV5214u laptop, preloaded with Vista for my spouse. I want to install Mandriva 2010.0, either as a sole system or as a dual boot. I am not familiar with Vista and think that I can better help her to learn computing if she is using a Linux machine.

Is this machine fully compatible for a Linux install? Will Linux be able to support the additional keys on the keyboard, such as the volume controls? I have made a recovery disk from the hidden partition. In the event that my spouse wishes to revert to Vista, will the recovery disk handle the fact that the disk has been repartitioned?

I have previously repartitioned Windows 2000 machines and installed dual boots but never done so on a preloaded laptop, The Windows 2000 machines always had full OEM Windows 2000 disks.

View 3 Replies View Related

Networking :: 10.112.112.112 Gateway In Wireless Router - What Does It Mean

Aug 16, 2010

a wireless router (box) is went stuck, I found that when it is stuck it uses strange IP local address remote address 10.112.112.112, today is also went stuck but this time the gateway was 10.112.112.112. I had to switch off, switch on teh router to function properly. I am using DSL connection normally the gateway is likie that 78.8.... and my IP (dynamic) like 78.8.240..... Is there any default meaning of 10.112.112.112 in teh net connections?

View 14 Replies View Related

Networking :: Can't Set Default Gateway To Different Subnet / Do That?

Feb 3, 2011

This is slackware 12. I'm trying to share my internet connection (on eth0) with a computer connected to eth1.

eth0 is 192.168.0.101, eth1 is 192.168.1.100 (different subnets).

But when I try to make eth1's default gateway the same as eth0's, see the error I get code...

View 7 Replies View Related

Networking :: Connection Lost To Gateway?

Oct 8, 2010

recently i have combined 2 machines into 1. after doing this, the ping to the new machine stops, for no apparent reason, and consequently all traffic to/from the machine also stops. when using the two machines individually this never happened.Lastly, if i restart the network, it kills everything (like the network just wont restart - it reaches the last interface and hangs), and if i reboot the machine, it seems to be fine for about 3-4hours.has anyone seen anything like this when connecting a large number of hosts to 1 gateway, using linux as the router?

View 2 Replies View Related

Networking :: Default Gateway On Different Subnet?

Jan 8, 2010

I am in a big confusion and searching an answer to calm down my mind.I have my eth0 has following configuration

` ` `
IP 192.168.1.100
mask 255.255.255.0

[code]....

View 3 Replies View Related

Networking :: Firewall Cannot Connect Beyond ISP Gateway

May 17, 2009

Our firewall (debian) currently has 4 public ip addresses (eth0 1.2.3.4, eth0:0 1.2.3.5, eth0:1 1.2.3.8, eth0:2 1.2.3.9) and 3 internal subnets (eth1 10.1.x.x, eth1:0 10.2.x.x, eth2 10.7.x.x). We are experiencing the following two problems which I believe have the same root cause. 1) The firewall cannot access beyond the isp gateway (1.2.3.1). 2) From externally, we can ping eth0 with no trouble, however, pinging the eth0:0, eth0:1 and eth0:2 interfaces have results similar to the following:

Code:
PING 1.2.3.8 (1.2.3.8) 56(84) bytes of data.
64 bytes from 1.2.3.8: icmp_seq=2 ttl=57 time=59.0 ms
64 bytes from 1.2.3.8: icmp_seq=2 ttl=57 time=63.0 ms (DUP!)
64 bytes from 1.2.3.8: icmp_seq=13 ttl=57 time=59.3 ms
64 bytes from 1.2.3.8: icmp_seq=13 ttl=57 time=63.0 ms (DUP!)
64 bytes from 1.2.3.8: icmp_seq=24 ttl=57 time=62.0 ms
64 bytes from 1.2.3.8: icmp_seq=24 ttl=57 time=65.6 ms (DUP!)

I get the feeling that I'm missing something obvious, especially since all traffic on the internal subnets can access externally as normal.

View 4 Replies View Related

Networking :: Gateway Changing The Hostname?

Mar 14, 2010

I am coming across a strange error with my gateway. When I do a "ping", this is what I get below:

k-63a5b848c6cb4:~ # ping simba
PING simba.gateway.2wire.net (192.168.1.69) 56(84) bytes of data.
64 bytes from k-63a5b848c6cb4 (192.168.1.69): icmp_seq=1 ttl=64 time=0.041 ms
64 bytes from k-63a5b848c6cb4 (192.168.1.69): icmp_seq=2 ttl=64 time=0.029 ms
64 bytes from k-63a5b848c6cb4 (192.168.1.69): icmp_seq=3 ttl=64 time=0.023 ms
64 bytes from k-63a5b848c6cb4 (192.168.1.69): icmp_seq=4 ttl=64 time=0.015 ms

Does anyone know what the problem could be?

View 1 Replies View Related

Networking :: Gateway / Firewall And Log Server

Aug 1, 2009

I got 2 servers, each on different locations (server 1 and server 2). I want all traffic on server1 included web browsing, applications etc., be always going through server2, like a gateway. I want the traffic to be encrypted (maybe use VPN?) So if I browse, or any logs pick up ip adresses from applications used by server1, I want it to display the IP address from server2 (Might be the wrong way to say it).

I always wants server2 to act as an firewall and logserver that logs all the traffic. I was thinking about using Snort for IPS/IDS solutions and OpenVPN for the traffic, but what can I use as a firewall? Most firewalls I find on google has its own OS/Distribution. Maybe Squid for logs? But squid does not support much protocols. Distribution on both servers are updated Debian/Ubuntu based.

View 3 Replies View Related

Networking :: How To Configure Intranet PC As Gateway

May 1, 2009

I am using Fedora 10. I have a network design like that:

WinServer --- (r1)router(r0) --- (eth1)LinuxPC(eth0) --- intranetPC
All netmask is 255.255.255.0
WinServer network is 192.168.1.0/24
intranetPC network is 10.10.0.0/24, gateway is IP of the LinuxPC(eth0): 10.10.0.2

Router:
r1 -IP: 192.168.1.253
r2 -IP: 10.10.0.253

LinuxPC
eth0 -IP: 10.10.0.2
eth1
-IP: 10.10.0.40
-GW: 10.10.0.253

I search in Internet several days to find how to configure the LinuxPC to a gateway. The LinuxPC can ping and connect the WinServer and intranetPC correctly, but the intranetPC cannot ping and connect the WinServer network.

I used the webmin to configure the Gateway.
I used the iptables to set allow all connect, than
iptables -t nat -A POSTROUTING -eth1 -j MASQUERADE
iptables -A FORWARD -i eth0 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
In "/etc/sysconfig/network" add "FORWARD_IPV4=true"

View 11 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved