SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have two ethernet:
- eth0 is wired (192.168.100.10)
- eth1 is wireless (192.168.100.12)
Both are recognized by kernel and working
currently:
- eth0 is set to be down
- eth1 is set to be up
I have set /etc/rc.d/rc.inet1.conf, but
confused with gateway setting.
My network should have gateway 192.168.100.1
But, with /etc/rc.d/rc.inet1.conf, when
i set gateway to 192.168.100.1, i can not
ping any host.
When i check route -n output, i see that gateway
is set to eth0, which is down. It should be eth1,
which is up.
So, temporarily, i have to set eth0 to be down,
in order to make a working connection.
My questions:
1. How to make gateway automatically set to
device currently up?
2. I want both device are set to be up, even
no cable is plugged into eth0. But, when
there is cable plugged, it can automatically
work.
But, I only see one GATEWAY variable for many interface definition. How could i set gatewat for eth1?
JE
sorry, didn't do enough research
rc.inet1 is only scripted for the default gateway, and it would take a bit of scripting to add a GATEWAY[*] variable to rc.inet1.conf.
Try setting IFNAME[0]="eth1" and see what happens. If it doesn't do what I think it would do (which is set up the default gateway thru eth1), then I'd recommend adding a line to rc.local.
If you define multiple default routes, your system will use all of them at random. If you have two default routes defined, and one of the routes is dead (like with the de-attached eth0 in the first post) then half your network packets will not arrive, and you will be quite dissatisfied with network performance.
Really, this type of setup (two cards, in the same network IP range, of which one or the other may get disconnected) needs DHCP in order to dynamically reconfigure the default gateway.
You can also run
Code:
/etc/rc.d/rc.inet1 restart
which will shortly disconnect you from your network but will also setup the correct new default route to the other network card, in case you unplug the wired card.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.