V
V
v_k2010-11-14 21:43:22
linux
v_k, 2010-11-14 21:43:22

default network interface in debian

Hello,
sorry for the noob question.
I have the following network interfaces:

eth1 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:55
inet addr: yyy.yyy.yyy.84 Bcast:yyy.yyy.yyy.255 Mask:255.255.255.0
inet6 addr : --clean-- Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1464826259 errors:0 dropped:0 overruns:0 frame:0
TX packets:1164216652 errors:0 dropped:0 overruns:0 carrier: 0
collisions:0 txqueuelen:1000
RX bytes:1150228826 (1.0 GiB) TX bytes:1092735623 (1.0 GiB)
Interrupt:215 Base address:0x6000

eth1:0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:55
inet addr:yyy.yyy.yyy.85 Bcast:yyy.yyy.yyy.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:215 Base address:0x6000

eth1:1 Link encap:Ethernet HWaddr xx:xx: xx:xx:xx:55
inet addr: yyy.yyy.yyy.86 Bcast:yyy.yyy.yyy.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:215 Base address:0x6000

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:451764543 errors:0 dropped:0 overruns:0 frame: 0
TX packets:451764543 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2821705653 (2.6 GiB) TX bytes:2821705653 (2.6 GiB)

If I type “wget internet.yandex.ru ” in the console, the page with the address yyy.yyy.yyy.86 is downloaded . How to make it so that by default the request was through eth1 (yyy.yyy.yyy.84)?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
NanoDragon, 2010-11-14
@NanoDragon

Make interface eth1 default. Well, or change IP addresses on the interfaces.

S
Sergey, 2010-11-14
@bondbig

in general, which interface was the last to rise, that and the dad acts as the default outgoing. A temporary solution is to do this:

ifconfig eth1 up yyy.yyy.yyy.84 netmask 255.255.255.0

The decision is permanent: either write it into a startup script, or shamanize for a long time, I'm too lazy to google how.

A
aaaDron, 2010-11-15
@aaaDron

maybe it will work like this:
ip route replace default dev eth1 src yyy.yyy.yyy.84
or like this:
iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to-source yyy.yyy.yyy.84

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question