eth0 fixed IP. eth1 DHCP gateway. Need access to eth0
5.10 Breezy configured as machine controller. Works great
eth0 is a fixed IP to communicate with controller comms board. Not easy at all to alter - the comms board is hard coded to listen on eth0 for commands. I can use eth1 as the default gateway and ping google.com, etc. But when I now attempt to communicate with the controller with netcat, e.g. Code:
echo !HH | nc 192.168.1.6 80 Using the -g option with netcat doesn't work either. I had a look at iptables but it doesn't seem to be able to do what I want. How I can still use eth0 as my communication port to the controller whilst eth1 is the default gateway? :scratch: |
Use a different subnet to talk to eth0 and eth1
You could configure 192.168.0.* to eth0 and 192.168.1.* to eth1 |
Quote:
Presently eth0 is fixed at 192.168.1.20. eth1 is DHCP as Default Gateway. Since I won't have access to the DHCP Server I cannot alter this. |
The network traffic cannot be easily routed to both interfaces. This is definitely not a simple setup.
There are many web sites that will explain TCP/IP subnets (google the words as a starter) and how they are used. |
Quote:
eth1 is required so that I can ssh into it from the Web. |
You are routing as soon as you have multiple interfaces. Your system needs a way to determine which interface to send the traffic onto based on destination ip address (and it does this by subnet). netstat probably reports to you that 192.168.1.0 is sent to eth1.
What is the destination ip address of your controller accessible through eth0? You will need to set some manual routing such that - 192.168.1.1 through 192.168.1.(controller's ip - 1) goes through eth1 - 192.168.1.(controller's ip) goes through eth0 - 192.168.1.(controller's ip + 1) goes through eth1 You should look at the "route add" command. |
Add a host route for 192.168.1.6 that uses the eth0 device.
|
Good ideas
Thanks, guys. Maybe I'll check out today if work allows :)
|
Stumped!
Quote:
Code:
route add -net default gw 192.168.1.6 dev eth0 Existing: Code:
root@machine:/home/Peter# route Code:
root@machine:/home/Peter# ifconfig BTW, why would I need a gateway for a fixed IP when traffic never leaves the computer? Same question for "broadcast" and "network" settings. |
Hi,
Don't know if it's an option for you but you could just configure a second IP (static) on the eth1 card that's in the range of the eth0. That way they can communicate with one another. Have a look at this Debian Networking guide. In the middle of the page are the commands/files to run/edit. Kind regards, Eric |
Is there any way you can change the controller's ip address from 192.168.1.6 to 192.168.0.6?
If so, then assign a 192.168.0.* ip address to eth0 and you will be able to reach both with no further headaches. BTW, your route command indicates a typo as it reports traffic for 192.16.1.0 going to eth0. |
Quote:
I don't know how, when or where the 192.16.1.0 address has come from. I certainly didn't add it to the routing table. I guess if I could edit this routing information it might just solve my problem but just where is this information stored? |
Look at "man routes". The location of the routes file should be indicated in the synopsis at the top. Probably /etc/sysconfig/network/routes or /etc/sysconfig/networking/routes.
The routes are probably set up at boot by a script, which reads the routes file. There may be a script in /etc/init.d/ which runs the script as a startup service. Code:
NAME |
Quote:
So no boot script or similar. Try something like this Code:
route add -host 192.168.1.6 dev eth1 Heres the listing of route from a host of mine Code:
Destination Gateway Genmask Flags Metric Ref Use Iface |
One step forward. Two steps back..
Thanks, guys :) but I'm getting nowhere fast. Have a look at this:
Code:
root@machine:/home/Peter# route Didn't find any routes file either - that makes any sense. Still puzzled where "christravel" appears from - only Chris I know has trouble with an abacus. Where to bang my head against now? :banghead: |
All times are GMT -5. The time now is 01:17 AM. |