Jump to content

zhex900

Members
  • Posts

    15
  • Joined

  • Last visited

zhex900's Achievements

New Here

New Here (1/7)

0

Reputation

  1. That is probably the reason for my problem. The funny thing is that my linux box are having some hardware problems. So I need to reinstall Mandrake on another box. So I won't be able to test it until Saturday. Nevertheless, just say eth0 and eth1 is working. Is the steps I listed at the top correct?
  2. I don't think so, because I used eth0 before. I am away from my box, so I only can double check it when I get home.
  3. I tried everything I can think of . But I my Mandrake 10 box still cannot bring up eth0 and eth1. Ultimately I want my Mandrake box to serve as a gateway/firewall/proxy/dhcp server. Internet-----(Mandrake box)------ Router ------- Clients ( Star topology) Please correct me if I am wrong, to get this working. I need to do the following steps. 1) Assign IP Address to both eth0 and eth1. (I could not get this part working) 2) Configure routing table. (Not sure how this works exactly) 3) Enable IP forwarding. (This is the easy part) 4) Configure Firewall (shorewall), to enable NAT. (Shorewall’s doc seems to be easy to understand, but since the above steps are not working probably. I don’t know whether my configure files for shorewall is correct or not) 5) Proxy (Squid). (This I’ll do later. Need to read some doc first) Now, I want to resolve the first two setups. So my aim is to have one NIC as dhcp and one static. Also I don't know whether I should add any additional routes, using route. First attempt. Eth0 static, eth1 dhcp. *eth1 is connected to my own gateway. (This is for testing, when it works eth1 should be connected to my cable modem) *eth0 is not connected [root@TIGER sysconfig]# cat /etc/sysconfig/network NETWORKING=yes HOSTNAME=TIGER GATEWAY=192.168.0.1 [root@TIGER sysconfig]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 BOOTPROTO=static DEVICE=eth0 NETMASK=255.255.255.0 BROADCAST=192.168.0.255 IPADDR=192.168.0.24 NETWORK=192.168.0.0 ONBOOT=yes [root@TIGER sysconfig]# cat /etc/sysconfig/network-scripts/ifcfg-eth1 GATEWAY=192.168.0.1 BOOTPROTO=dhcp DEVICE=eth1 MII_NOT_SUPPORTED=yes ONBOOT=yes METRIC=12 [root@TIGER sysconfig]# ifconfig eth0 Link encap:Ethernet HWaddr 00:02:44:11:DD:24 inet6 addr: fe80::202:44ff:fe11:dd24/64 Scope:Link UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:29 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 b) TX bytes:2226 (2.1 Kb) Interrupt:9 Base address:0x2f00 eth1 Link encap:Ethernet HWaddr 00:50:22:E9:8E:A4 inet addr:192.168.0.10 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: fe80::250:22ff:fee9:8ea4/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:974 errors:0 dropped:0 overruns:0 frame:0 TX packets:552 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:157364 (153.6 Kb) TX bytes:75286 (73.5 Kb) Interrupt:11 Base address:0x4e00 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:3814 errors:0 dropped:0 overruns:0 frame:0 TX packets:3814 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:314322 (306.9 Kb) TX bytes:314322 (306.9 Kb) [root@TIGER sysconfig]# netstat -r Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 192.168.0.0 * 255.255.255.0 U 0 0 0 eth1 127.0.0.0 * 255.0.0.0 U 0 0 0 lo default 192.168.0.1 0.0.0.0 UG 0 0 0 eth1 [root@TIGER sysconfig]# service network restart Shutting down interface eth0: [ OK ] Shutting down interface eth1: [ OK ] Shutting down loopback interface: [ OK ] Disabling IPv4 packet forwarding: [ OK ] Setting network parameters: [ OK ] Bringing up loopback interface: [ OK ] Bringing up interface eth0: [FAILED] Bringing up interface eth1: [ OK ] [COLOR=red]Operation failed.[/COLOR] Why do I have a "Operation failed"? At this stage I everything seems to work ok. Since eth1 is allocated a IP, and can ping machines in and out side of the network. Second attempt After eth0 cable is connected to my gateway router. So both eth0 and eth1 are connected to my gateway router. [root@TIGER sysconfig]# service network restart Shutting down interface eth0: [ OK ] Shutting down interface eth1: [ OK ] Shutting down loopback interface: [ OK ] Disabling IPv4 packet forwarding: [ OK ] Setting network parameters: [ OK ] Bringing up loopback interface: [ OK ] Bringing up interface eth0: [ OK ] Bringing up interface eth1: [ OK ] [COLOR=red]Operation failed.[/COLOR] [root@TIGER etc]# netstat -r Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 192.168.0.0 * 255.255.255.0 U 0 0 0 eth1 127.0.0.0 * 255.0.0.0 U 0 0 0 lo No gateway so cannot connect to outside. [root@TIGER sysconfig]# ifconfig eth0 Link encap:Ethernet HWaddr 00:02:44:11:DD:24 inet6 addr: fe80::202:44ff:fe11:dd24/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:29 errors:0 dropped:0 overruns:0 frame:0 TX packets:60 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:5002 (4.8 Kb) TX bytes:4450 (4.3 Kb) Interrupt:9 Base address:0x2f00 eth1 Link encap:Ethernet HWaddr 00:50:22:E9:8E:A4 inet addr:192.168.0.10 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: fe80::250:22ff:fee9:8ea4/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:992 errors:0 dropped:0 overruns:0 frame:0 TX packets:577 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:160938 (157.1 Kb) TX bytes:79650 (77.7 Kb) Interrupt:11 Base address:0x4e00 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:3814 errors:0 dropped:0 overruns:0 frame:0 TX packets:3814 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:314322 (306.9 Kb) TX bytes:314322 (306.9 Kb) Eth0 still no IP Address. Why? Attempt three. After I swap the ifcfh-ethx files between eth0, eth1 So now eth0 is dhcp, and eth1 is static with ip address 192.168.0.24 [root@TIGER network-scripts]# ifconfig eth1 Link encap:Ethernet HWaddr 00:50:22:E9:8E:A4 inet addr:192.168.0.24 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: fe80::250:22ff:fee9:8ea4/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1079 errors:0 dropped:0 overruns:0 frame:0 TX packets:633 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:171246 (167.2 Kb) TX bytes:84854 (82.8 Kb) Interrupt:11 Base address:0x4e00 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:3814 errors:0 dropped:0 overruns:0 frame:0 TX packets:3814 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:314322 (306.9 Kb) TX bytes:314322 (306.9 Kb)
  4. Thank you very much for your reply. I just find out one of my router ports is not working, so I put the cable into a port that works. Now its working fine. However I still need your help. I want my linux box work like the following: Internet --- Cable Modem --- (eth0) Linux box (eth1) --- router ---internal network. So I want my linux box to act like a gateway. (I hope this is what a gateway do) Two question: 1) How do I get my eth1 working. 2) How do I set the routering table to pass all eth0 packets to eth1.? I hope this is not too much to ask.
  5. I tried to setup static IP mcc, but it doesn't work. I want to get my first NIC work first. I have no idea how to configure the second card.
  6. I can bring up my eth0 but I only can ping itself. I cannot ping even the router. I have two ethernet cards, I want to get both of them working. Can some please help me. As you can see I am using static ip. I cannot even bring up eth0 using DHCP. %cat /etc/resolv.conf search nsw.optushome.com.au nameserver 203.2.75.132 nameserver 198.142.0.51 %lspci | grep Ethernet 00:0b.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL -8129/8139C/8139C+ (rev10) 00:0c.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL -8129/8139C/8139C+ (rev10) %ifconfg eth0 Link encap:Ethernet HWaddr 00:02:44:11:DD:24 inet6 addr: fe80::202:44ff:fe11:dd24/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:195 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 b ) TX bytes:33386 (32.6 Kb) Interrupt:9 Base address:0x9f00 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:243 errors:0 dropped:0 overruns:0 frame:0 TX packets:243 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:20570 (20.0 Kb) TX bytes:20570 (20.0 Kb) #cat /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 BOOTPROTO=static IPADDR=192.168.0.11 NETMASK=255.255.255.0 NETWORK=192.168.0.0 BROADCAST=192.168.0.255 onBOOT=yes MII_NOT_SUPPORTED=yes # route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.0.0 * 255.255.255.0 U 0 0 0 eth0 127.0.0.0 * 255.0.0.0 U 0 0 0 lo default 192.168.0.1 0.0.0.0 UG 0 0 0 eth0 %time /etc/init.d/network restart Shutting down interface eth0: [ OK ] Shutting down loopback interface: [ OK ] Setting network parameters: [ OK ] Bringing up loopback interface: [ OK ] Bringing up interface eth0: [ OK ] 1.90user 0.66system 1:38.44elapsed 2%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+64810minor)pagefaults 0swap % /etc/init.d/network status Configured devices: lo eth0 Currently active devices: lo eth0
  7. I have spent a few hours looking at google.groups to figure out how to setup a gateway & firewall on my mandrake 10 box. Here is what I want. Internet --- Cable modem --- Linux box --- Router --- Any clients. 1) Just to get the Linux box to forward packets. 2) The most important function I want my Linux box to do, is monitoring and restricting how much each client in the internal network are able to download. This can be done using Squid right? Is this the easiest way? 3) After I get the above working, I can play around with firewall, email, ssh, ... etc Can someone point to me to a place where I can familiarise of how to get my gateway running. The current configuration is this. Internet --- Cable moderm --- Router --- Clients (Window and Linux machines) My Linux box have two NICs. Eth0 is up and running nicely. I haven’t try to setup eth1 yet. (I am kind of scared of setting up eth1, I'll probably run in trouble again). :deal:
  8. Finally its working now. All I did was install and run pump. Thank you very much for everyones help
  9. After I make the above changes and `service network restart` I still cannot access the net. Mate, this thing is getting really complicated. The fanny thing is that even after I set my router to static ip. Other machines in the network can still use dhcp, other machines can still use the internet. Is this normal? I have also tried to restart my router, my turning the power on/off. Is this normal? # iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination
  10. Ok. Now this question is getting really elementary but I need your help. In my router configure page, the static address section have the following default values: IP address 211.30.99.78 IP subnet mask 255.255.255.0 Gateway IP address 211.30.99.1 Do I need to change these things? Another thing, is that my windows machine is using static ip, while my router still is configured to use dhcp. My windows box is working fine.
  11. The firewall is disabled, if I enable the firewall on the linux box, other machines in the network can't even ping the linux box. I have a NETGEAR FR114P Router with a in build firewall, I don't think I can disable shcp.
  12. trouble with setting up static IP, cannot get on to the internet My windows machine have the following #ipconfig /alll Windows IP Configuration Host Name . . . . . . . . . . . . : zhex900 Primary Dns Suffix . . . . . . . : Node Type . . . . . . . . . . . . : Unknown IP Routing Enabled. . . . . . . . : No WINS Proxy Enabled. . . . . . . . : Yes Ethernet adapter Local Area Connection: Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Intel(R) PRO/100 VE Network Connection Physical Address. . . . . . . . . : 08-00-46-99-B6-28 Dhcp Enabled. . . . . . . . . . . : No IP Address. . . . . . . . . . . . : 192.168.0.22 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.0.1 DNS Servers . . . . . . . . . . . : 203.2.75.132 198.142.0.51 This is what I did to setup the static ip on my mandrake10 box. # ifconfig eth0 inet 192.168.0.11 netmask 255.255.255.0 # route add default gw 192.168.0.1 eth0 The linux box only can see machine within the internal network, but can not ping anything outside. ping 198.142.0.51 PING 198.142.0.51 (198.142.0.51) 56(84) bytes of data. From 192.168.0.11 icmp_seq=1 Destination Host Unreachable From 192.168.0.11 icmp_seq=2 Destination Host Unreachable From 192.168.0.11 icmp_seq=3 Destination Host Unreachable --- 198.142.0.51 ping statistics --- 5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3998ms , pipe 3 cat /etc/resolv.conf search nsw.optushome.com.au nameserver 203.2.75.132 nameserver 198.142.0.51 # ppp temp entry Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.0.0 * 255.255.255.0 U 0 0 0 eth0 127.0.0.0 * 255.0.0.0 U 0 0 0 lo default 192.168.0.1 0.0.0.0 UG 0 0 0 eth0 #cat /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 BOOTPROTO=static IPADDR=192.168.0.11 NETMASK=255.255.255.0 NETWORK=192.168.0.0 BROADCAST=192.168.0.255 onBOOT=yes MII_NOT_SUPPORTED=yes
  13. Ya there is two ethernet cards in my machine. I want to use it as a server, so one in and one out. I guess I need both ethernet cards working. Now, I am pretty sure is the ip problem, since after installation it works for a little while then the box can't determine its own ip address. Is it easier if I make the ip address static? Cheers Jake
  14. :deal: After installing Mandrake 10.1 eth0 is running good. However after reboot, "Bringing up eth0: FAILED" . I am only basic linux user can someone help me. %cat /etc/resolv.conf search nsw.optushome.com.au nameserver 203.2.75.132 nameserver 198.142.0.51 %lspci | grep Ethernet 00:0b.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL -8129/8139C/8139C+ (rev10) 00:0c.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL -8129/8139C/8139C+ (rev10) I assume this means that my box can see the two ethernet cards, so the driver is working. %ifconfig eth0 192.168.0.11 %ping 192.168.0.5 PING 192.168.0.5 (192.168.0.5) 56(84) bytes of data. From 192.168.0.11 icmp_seq=1 Destination Host Unreachable From 192.168.0.11 icmp_seq=2 Destination Host Unreachable From 192.168.0.11 icmp_seq=3 Destination Host Unreachable --- 192.168.0.5 ping statistics --- 5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3998ms , pipe 3 %ping 192.168.0.11 PING 192.168.0.11 (192.168.0.11) 56(84) bytes of data. 64 bytes from 192.168.0.11: icmp_seq=1 ttl=64 time=0.065 ms --- 192.168.0.11 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.065/0.065/0.065/0.000 ms %ifconfg eth0 Link encap:Ethernet HWaddr 00:02:44:11:DD:24 inet6 addr: fe80::202:44ff:fe11:dd24/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:195 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 b ) TX bytes:33386 (32.6 Kb) Interrupt:9 Base address:0x9f00 eth0:9 Link encap:Ethernet HWaddr 00:02:44:11:DD:24 inet addr:127.255.255.255 Bcast:127.255.255.255 Mask:255.0.0.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Interrupt:9 Base address:0x9f00 eth1 Link encap:Ethernet HWaddr 00:50:22:E9:8E:A4 inet6 addr: fe80::250:22ff:fee9:8ea4/64 Scope:Link UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:23 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 b ) TX bytes:2538 (2.4 Kb) Interrupt:11 Base address:0xae00 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:243 errors:0 dropped:0 overruns:0 frame:0 TX packets:243 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:20570 (20.0 Kb) TX bytes:20570 (20.0 Kb) %ifup eth0 Determining IP information for eth0... done. /sbin/ifup: line 433: 7771 Hangup /etc/init.d/tmdns reload >/dev/null 2>&1 % /etc/init.d/network status Configured devices: lo eth0 Currently active devices: lo eth1 %time /etc/init.d/network restart Shutting down interface eth0: [ OK ] Shutting down loopback interface: [ OK ] Setting network parameters: [ OK ] Bringing up loopback interface: [ OK ] Bringing up interface eth0: [ OK ] 1.90user 0.66system 1:38.44elapsed 2%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+64810minor)pagefaults 0swaps %ping 192.168.0.11 connect: Network is unreachable %cat /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 BOOTPROTO=dhcp onBOOT=yes MII_NOT_SUPPORTED=yes NEEDHOSTNAME=yes check_link_down(){ return 1; } :-?
×
×
  • Create New...