using wget on selected network interfaces


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers using wget on selected network interfaces
# 1  
Old 04-08-2010
Question using wget on selected network interfaces

Hi there,

I have a Linux Debian server with 2 network cards each connected through a different gateway :
Code:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
        address 192.168.1.224
        netmask 255.255.255.0
        gateway 192.168.1.1
auto eth1
iface eth1 inet static
        address 192.168.1.225
        netmask 255.255.255.0
        gateway 192.168.1.2

I would like to use wget with the ability to select which interface to use.
Is it possible?
How can I achieve that?

Thanks for your help
Santiago
# 2  
Old 04-08-2010
Quote:
Originally Posted by chebarbudo
I would like to use wget with the ability to select which interface to use.
Is it possible?
How can I achieve that?
Depending on how you're using wget, you can use the routing table to send traffic through the right interface (assuming different destinations for those wgets).

js.
# 3  
Old 04-08-2010
Haven't done it myself, but look into '--bind-address=ADDRESS' option
# 4  
Old 04-08-2010
Interface: no
Address: yes. According to the man page for wget you'd use the --bind-address option.
# 5  
Old 04-09-2010
I stupidely lost the connection to my server by using ipconfig on eth0 instead of eth1.
Anyway, the server is in my office, I will reset it tomorrow.

So as I said...
eth0 is 192.168.1.224 with gateway 192.168.1.1 (it's a livebox with wan 79.15.24.51)
eth1 is 192.168.1.225 with gateway 192.168.1.2 (it's a neufbox with wan 77.240.25.38)

My goal is to be able to tell each gateway's wan address using Current IP Check
So according to what you say (and I will check that tomorrow), the following commands should give me what I expect :
Code:
wget -qO- http://checkip.dyndns.com/ --bind-address 192.168.1.224
wget -qO- http://checkip.dyndns.com/ --bind-address 192.168.1.225

I'll come back to you with an answer tomorrow morning (9:00 Paris / 8:00 London).

Thanks for your advice
Santiago

---------- Post updated at 08:58 ---------- Previous update was at 01:10 ----------

Sorry guys,

I get exactly the same result regardless of the bind address I'm using :
Code:
$ wget -qO- http://checkip.dyndns.com/ --bind-address 192.168.1.224
<html><head><title>Current IP Check</title></head><body>Current IP Address: 79.15.24.51</body></html>
$ wget -qO- http://checkip.dyndns.com/ --bind-address 192.168.1.225
<html><head><title>Current IP Check</title></head><body>Current IP Address: 79.15.24.51</body></html>

Do you have an explanation? an alternate solution?

Thx for your help
Santiago
# 6  
Old 04-09-2010
Just checked: curl has an --interface option, which has it bind to an specific interface. Can't guarantee it will work, tho, since it might be possible that your routing table sends out everything on the same interface regardless of this.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux

Network interfaces error

I just ran sudo service networking start on Ubuntu 16.00 and came out with error message Job for networking service failed because control process exited with error code see systemctl status networking.service I tried to also run this command systemctl status networking.service I also got an... (4 Replies)
Discussion started by: DOkuwa
4 Replies

2. UNIX for Dummies Questions & Answers

/etc/network/interfaces

i need a one liner command that writes in /var/log/net.log the date when i connect to the network and when i disconect ..i know that i need to write somethin in /etc/network/interfaces but idk what ! please help (1 Reply)
Discussion started by: g0dlik3
1 Replies

3. UNIX for Advanced & Expert Users

How to bond network interfaces

All, I have a quad NIC on a V880 running Solaris 9. I've heard you can bond interfaces together and get better throughput. I found this link that seems to describe the process well. However, the command mentioned (dladm) is missing. Is there some package I need to install to get this command? Thx.... (2 Replies)
Discussion started by: agcodba
2 Replies

4. Debian

/etc/network/interfaces problem

Hello i am configuring a debian lenny sever ,/etc/network/interfaces is modified so that eth1 takes a static IP address then i save it wq! then i restart the networking , /etc/init.d/networking restart . but after reboot ,the file is reset ,note that the interfaces had by defauklt IPv6 address... (5 Replies)
Discussion started by: learn82
5 Replies

5. Solaris

Network Interfaces

I got second IOU in my M5000 but not able bring internal network interfcae .. ike i don't get link on those 2 interfaces .. and the same network cable plugged in PCI network card it works like a charm Is there any special way to enable the internal IOU interfaces or i have bad nics ? (8 Replies)
Discussion started by: fugitive
8 Replies

6. AIX

NIM w/ two network interfaces

Hi all, this is my first post on this forum. My main problem is this: I have a NIM server that I am trying to configure two interfaces on. One interface is for an internal Admin VLAN, the other is so that the server can use SUMA to pull updates. The problem is that I need help w/ the routing.... (1 Reply)
Discussion started by: snakernetb
1 Replies

7. AIX

NIM w/ two network interfaces

Hi all, this is my first post on this forum. My main problem is this: I have a NIM server that I am trying to configure two interfaces on. One interface is for an internal Admin VLAN, the other is so that the server can use SUMA to pull updates. The problem is that I need help w/ the routing.... (0 Replies)
Discussion started by: snakernetb
0 Replies

8. SCO

Network interfaces problem

Hi, I have problems with my SCO unix network interfaces. Intel integrated adapter was failing, so I installed new one - 3COM adapter into free PCI slot. Installed driver using SCO Software manager - successfully Added new Network adapter using SCO Network configuration manager - successfully... (0 Replies)
Discussion started by: vilius
0 Replies

9. IP Networking

Network interfaces problem

Hi, I have problems with my SCO unix network interfaces. Intel integrated adapter was failing, so I installed new one - 3COM adapter into free PCI slot. Installed driver using SCO Software manager - successfully Added new Network adapter using SCO Network configuration manager - successfully... (0 Replies)
Discussion started by: vilius
0 Replies

10. Solaris

HOW-TO Retrieve all network interfaces??!

Yes. But just wait a bit. How to do it via system calls? I'm just a newbie in Unix\Linux\Solaris e.t.c. programming. Can anyone help me? I need an advice probably how to do it or may be what API to read... :) Please, help... (2 Replies)
Discussion started by: LocalStorm
2 Replies
Login or Register to Ask a Question