Networking :: Kernel - Forward Packets From Eth0 To Eth1 And Eth1-to Eth0 As Well As Get A Copy Of These Packets For Analysis
Sep 27, 2010
I have a hardware device with two ethernet ports, eth0 and eth1 running Centos 5. Basically my goal is to forward packets from eth0->eth1 and eth1->eth0 as well as get a copy of these packets for analysis. If I set IP routing to do the forwarding then I won't get a copy of the packets for analysis.
I try to generate a server client code. What i try to do is sending video streams from eth0 and eth1 to the other server programs' eth0 and eth1. In order to do that, i decided to use SO_BINDTODEVICE. But the code is not working. Am i misunderstood the usage of SO_BINDTODEVICE.
1-Defining two ports 2-Defining two sockets 3-Assigning host ips on them
I need to setup two ethernets in my Centos box. OK no problem both ethernet and 1 virtual works perfect. eth0, eth1 and eth1:0. I'm trying to set up diferent routes for eth0 and eth1/eth1:0 I need eth0 has a 192.168.1.1 gateway and eth1/eth1:0 192.168.1.100 gateway.I think I've tried almost every thing but always get one gateway for all the eth.These are my config..
/sbin/ifconfig eth0 Link encap:Ethernet HWaddr 00:XX:XX:XX:XX:XX inet addr:192.168.1.168 Bcast:192.168.1.255 Mask:255.255.255.0[code]......
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
I obviously never get an answer since the request is passed via eth1. 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?
I have two servers on a vlan at my datacentre/colocation and previously both servers had public IPs on their eth0 interfaces. The servers are HP ProLiant DL360s - one is a G4 and one is a G5 The newer G5 is now the LAMP server and the G4 has been retired and I want to repurpose it as an iSCSI target using openfiler freenas or similar.
My G5 has public/static IPs lashed to the eth0 physical interface and the eth1 is not configured to do anything yet. The G4 will have both interfaces available - perhaps one for ssh access from one of my static public IPs and the other to be a private IP on the local vlan. Here is what I am trying to get my head around...
The G5 eth0 - Public IP - full LAMP services on two or three virtual interfaces eth1 - Private IP 192.168.0.1 The G4 eth0 - Public IP for ssh eth1 - Private IP 192.168.0.2
Because my traffic between eth1 on these boxes is via private IPs on the local private vlan it doesn't add to my quota for bandwidth. How do I go about configuring the routing and gateways and other aspects of this so that I can run a private IP space network between the eth1s and still serve the outside world from the eth0s...
I am afraid that if I assign the private IPs to the eth1 interfaces the routing may either not work or interfere with the access to the production internet facing interfaces (eth0s).
I need to set up my centOS computer as a firewall in my home network. Ive got 2 interfaces, eth0 and eth1. I want to allow and forward all traffic on eth0 and block all traffic on eth1 except ssh, ping(icmp) and DNS. How do I do this? Ive tried some editing in /etc/sysconfig/iptables but no luck.
I've noticed that when Linux boots on different machines or with different versions, the network card is assigned to eth0 or to eth1, when there is only one network card. What is the difference and is there any way to tell which one it will be for any machine or version?
I have two network interfaces on my computer but only one of them is connected to an Ethernet cable. Until now on every Fedora release, the activated primary interface has been named as eth0 and everything has always worked well without any problem. Recently I switched to Fedora Core 12 and surprisingly I observed that for the first time, my primary interface has been considered by the system to be eth1 instead of eth0. I tried to replace the content of ifcfg-eth0 by ifcfg-eth1, yet system gave me an error that there was MAC address mismatching. I conserved their MAC addresses in their files and just replaced other connection parameters ( such as IP ADDR, NETWORK, NETMASK, etc.) but it did't work. When I do "server network restart", the command blocks.
As I try to install oracle on this system, regarding the fact that oracle requires static network configuration on the primary network interface, I don't know how to proceed in order to set eth0 as my primary interface (or rather set the current eth1 to eth0 because it is actually eth1 that refers to my activated primary network card).Just one more time, I would like to remark, that with previous versions of the Fedora Core, on the same computer (with the very same two network cards) I never had problem and I had installed oracle on the system with success, having the statically configured eth0 correctly detected by the system.
im a linux noob dont get techy ill die of brain fry im running a craft bukkit minecraft server on my 11.04 ubuntu server. however the server uses my only 10m Ethernet cable that i normaly use for my ps3 (i will NOT go wireless. i hate it (or dont like it)) therefor i found an old PCI NIC in an old computer, its a 10/100 realtek one. ifconfig detects it (after two commands:
Code: ifconfig eth0 up dhclient eth0 )
now i need to send the internet to my ps3 too.i know the connection wont be blazing fast but isnt it okay?it musnt interrupt the minecraft server. if you need info just ask. ill try and provide them.
I need to have the configuration showed on the attached file. I have two machines, one PC (ubuntu 9.10 ) and one embedded CPU with a tailored linux version starting from 2.4.31 linux kernel with Busybox running on PPC architecture.
PC address is 192.168.30.70.
On CPU board I have two ethernet interfaces with addresses : eth0 192.168.30.30 netmask 255.255.255.0 eth1 192.168.30.40 netmask 255.255.255.0
PC sends messages alternatively to 192.168.30.40 and to 192.168.30.30 .Between two machines there is an ethernet switch to allow messages flowing.
I use ping (from two shells on PC I ping the two addresses on CPU) to simulate messages from PC to CPU and I see this behaviour:
Starting from a situation in which CPU responds to the pings I try to disconnect cable connected to eth0 on CPU. I cannot see any interruption on ping reply on the eth0 port. If i reconnect the cable on eth0 and I disconnect cable on eth1 there are no reply to the two pings (neither from eth0 nor from eth1). It seems that all data flows on one cable just because the addresses are on the same subnet. Is this right?
If this is the right behaviour how can i separate data from PC to CPU in order to force packets to flow on two cables and avoid this sort of internal routing beetween eth0 and eth1?
Ok, so eth0 is up and working great. eth1, however, comes up with a link light, however the packet counters in ifconfig remain at 0. Appears that eth1 isn't working.
Here's my setup:
-Dell latitude CPi laptop with 2 PCMCIA network cards and no built-in ethernet. -Slackware v11 -eth0 is connected inside my router on my 192 network. Static address with good connectivity -eth1 is connected on the other side of my router in promiscuous mode in order to listen to the traffic coming into my network.
Troubleshooting so far: I have switched the pcmcia cards between slots and regardless of which card is in eth0 or eth1, eth0 works and eth1 does not. I have also switched the card dongle between cards as well as the ethernet cabling between the cards. With any of the combinations eth0 works like a champ but eth1 does not, so I think I've ruled out hardware problems.
I'm having a problem and despite I have googled a lot cant find the root cause. I have a server with two embedded NICs and centos 5.5 loaded. I need to have one NIC with a fix internal IP address to communicate with the intranet and a second NIC with a fix address from my telephone provider. I know I cant have two different gateways on the net so I configured only the gateway for the second NIC leaving the field empty for the first.
I found that the first NIC is handling all the traffic for both interfaces (eth0 and eth1) and the second NIC is in standby (or doing nothing). This is causing the traffic intended for the second NIC never reach their destination. After a couple days working with the BIOS and other configuration files I tried another way of solve the issue. I put a fix address for the first NIC and another fix address for the second NIC (both in the same subnet) and from a computer pinged successfully both addresses. However if I disconnect the cable for the first NIC both interfaces goes down (eth0 and eth1) and both pings fails. If I disconnect the cable for the second NIC (with the first one connected) both pings still running without any disturbance.
I worked also in a second server with different hardware (different kind of motherboard, different NIC manufacturer, etc.) but the problem is also present in this second server. I was reading about NIC bonding or teaming, but this configuration is not present in the modprobe.conf or in the ifcfg-eth0 files, so I believe the problem is not related with this feature. Do you know what is happening with the NICs and how can I get two really, fully independent NICs?
I have 2 network interface on 1 server and i got a problem finding a solution for it.I have 1 java application and i want it to use the eth1 for that application and not the default eth0. On eth0 i got for example xx.xxx.xx.22 and on eth1 i got xx.xxx.xx.23 and i want the java app to use the 23 ip one.
I've got a machine running 9.10 with two network interfaces, one being motherboard based (atl1) and the other in a PCI slot (e100). By default at boot the interfaces come up in the wrong order. I'd prefer to have the e100 come up as eth0 instead of eth1. And then have the atl1 come up on eth1 instead of eth0. Both interfaces use static addresses and IP4 routing should be active across them. Where do I configure things to force the specific settings?
I have a linux machine with 2 ethernet ports(eth0 and eth1). eth0 is connected to a router which assigns it an IP address 192.168.1.2. eth1 is connected to a switch and I assigned it an IP address 192.168.1.254 using "ifconfig eth1 192.168.1.254 netmask 255.255.255.0 up". How do I ping eth0 from eth1?
I am using ubuntu cli 10.04 for several different computers with different network cards, any time I plug in my persistent usb (ubuntu installed on usb) to computer the network would not work, when I find out what is up I see that it is up on next eth driver, I cant enter up to 50 or 100 or 500 entry there all the time and same thing with wireless since I use radius authentication its even makes it worse.
So to summarize: sudo vi /etc/network interfaces auto eth0 ifup dhcp iface eth0 inet ... ... ... auto eth100 ifup dhcp iface eht100 inet .... How to keep one entry for all those different computers (one for eth0 and one for wlan0)?
Im setting up a server thats connected to a large network. Now my external ip on the network is static and is 10.0.12.15. What I want is to create a dhcp network using the second port of my box. The first port eth0 goes to my network with the static ip 10.0.12.15 and my second port is connected to a switch with the static ip 192.168.12.1. Now dhcp works fine but none of the boxes that are connected to the internal ip cannot connect to the internet. Iv tried using squid and manual static ip routes. Im not using network manager or anything cause its a command line server.
Once or twice an hour or every few hours the interface will drop off. When this happens and comes back up and ssh sessions I have open will sit there and lag for 15-20 sec while, I assume, the connection is re-established. Any sessions I have open to the mySQL database will be dropped and I'll be given error messages associated with loosing connection to the SQL server. I have run a constant ping against the server and when the interface seems to drop off I'll get 10 or so host unreachable and it'll then start to reply again. This happens with both eth0 and eth1 on this Dell Poweredge 850 running 11.04. I have done a "sudo lspci -v" on both the server acting up and another Natty box that doesn't have this issue but the same hardware. They both are using the same driver versions though it seems certain options are slightly different between the two.
Working Server: Code: 04:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5721 Gigabit Ethernet PCI Express (rev 11) Subsystem: Dell Device 01b6 Flags: bus master, fast devsel, latency 0, IRQ 16 Memory at fe8f0000 (64-bit, non-prefetchable) [size=64K] Expansion ROM at <ignored> [disabled] Capabilities:  Power Management version 2 Capabilities:  Vital Product Data <?> Capabilities:  Message Signalled Interrupts:Mask-64bit+ Queue=0/3 Enable- Capabilities: [d0] Express Endpoint, MSI 00 Capabilities:  Advanced Error Reporting <?> Capabilities: [13c] Virtual Channel <?> Kernel driver in use: tg3 Kernel modules: tg3
Broken Server: Code: 04:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5721 Gigabit Ethernet PCI Express (rev 11) Subsystem: Dell Device 01b6 Flags: bus master, fast devsel, latency 0, IRQ 16 Memory at fe8f0000 (64-bit, non-prefetchable) [size=64K] Expansion ROM at <ignored> [disabled] Capabilities:  Power Management version 2 Capabilities:  Vital Product Data Capabilities:  MSI: Enable- Count=1/8 Maskable-64bit+ Capabilities: [d0] Express Endpoint, MSI 00 Capabilities:  Advanced Error Reporting Capabilities: [13c] Virtual Channel Kernel driver in use: tg3 Kernel modules: tg3
I've checked the cable, it's a pre-made with both ends looking good. I even swapped it out for a fresh home made cable and the problem still persists.
I'm trying to setup a network with a bridge on Debian Lenny (too bad most bridging information is for 2.4 kernel, maybe I'll write some if I get this to work). I've seen somewhat similar problems involving bridging for VMs and a couple involving Fedora, but people say that it was either a driver problem or it was fixed magically.I'm using a few Intel Pro 100s, which I'm pretty certain have had driver support in the kernel for years now. Magic doesn't happen.Here's /etc/network/interfacesQuote:
auto loiface lo inet loopbackauto br0 iface br0 inet staticbridge_ports eth0 eth1bridge_maxwait 0address 126.96.36.199netmask 255.255.255.254gateway 188.8.131.52
I have 2 LAN ports. one from the motherboard (on board) and the other from a lan card i bought a few days back. one is use for browsing the net, the other for a media player.
problem is i cant connect to both the eth0 and eth1 at the same time. i have to disconnect one of them to connect to the other. and this really gets irritating as it doesnt always work as flawlessly as it should. what am i doing wrong?
I'll start by saying that most of this is built inside of a 64bit ESXi 4.1.0 server. Should be obvious by the picture below.
Trying to set up a bridged CentOS box. Ultimate goal is to set up a Transparent Firewall. The machine labeled 'Desktop' is a Windows XP running DHCP. It gets assigned an Internet routeble IP address. At this point, nothing is running a firewall.
Symptoms: Gateway can ping CentOS bridge CentOS bridge can ping gateway CentOS bridge can resolve DNS names and ping FQDNs on the Internet. CentOS bridge CAN NOT ping Desktop