Fixed IP on boot & Default Routes

Issues related to configuring your network

Fixed IP on boot & Default Routes

Postby GuaresFST » 2012/05/20 19:34:43

Hi team,

Have a serie of doubts that i can´t resolve by myself,

In first place, the interfaces on my start on boot, but in the only one that i need fixed ip (p1p1), I must to configure the IP everytime that the server reboot

-This is how after one reboot the interface going up
[root@localhost ~]# ifconfig p1p1
p1p1 Link encap:Ethernet HWaddr 00:15:17:EE:0E:1E
inet6 addr: fe80::215:17ff:feee:e1e/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:56 errors:0 dropped:0 overruns:0 frame:0
TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:9657 (9.4 KiB) TX bytes:2178 (2.1 KiB)
Interrupt:16 Memory:df980000-df9a0000


- So them i must to configure the IP that i need (the interface is used like gateway and DHCP server of one LAN)
[root@localhost ~]# ifconfig p1p1 172.20.0.1 netmask 255.255.252.0
[root@localhost ~]# service dhcpd start
Starting dhcpd: [ OK ]
[root@localhost ~]# ifconfig p1p1
p1p1 Link encap:Ethernet HWaddr 00:15:17:EE:0E:1E
inet addr:172.20.0.1 Bcast:172.20.3.255 Mask:255.255.252.0
inet6 addr: fe80::215:17ff:feee:e1e/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:56 errors:0 dropped:0 overruns:0 frame:0
TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:9657 (9.4 KiB) TX bytes:2178 (2.1 KiB)
Interrupt:16 Memory:df980000-df9a0000



I try to find the chkconfig file for the interface, but the same doesn´t exist
[root@localhost ~]# cat /etc/sysconfig/network-scripts/
ifcfg-lo ifdown-post ifup-bnep ifup-post net.hotplug
ifdown ifdown-ppp ifup-eth ifup-ppp network-functions
ifdown-bnep ifdown-routes ifup-ippp ifup-routes network-functions-ipv6
ifdown-eth ifdown-sit ifup-ipv6 ifup-sit
ifdown-ippp ifdown-tunnel ifup-isdn ifup-tunnel
ifdown-ipv6 ifup ifup-plip ifup-wireless
ifdown-isdn ifup-aliases ifup-plusb init.ipv6-global



So i guest that i must to create the same, I already tryed, but without success, the interface don´t take the fixed ip after boot

And this give me another issue too, since the computers from my lan are able to ping my p1p1 interface normally (after manually configure the p1p1 interface) , and my em1 interface too (IP 192.168.1.10) but i can´t reach the gateway (ADSL Router) of my em1 interface (192.168.1.1) that exit to internet. I disable iptables just to be sure that firewall was blocking me, but this was not the issue

I test some default routes and try to fix another ones, but without success. This are my routes by default
[root@localhost ~]# netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 em1
172.20.0.0 * 255.255.252.0 U 0 0 0 p1p1
default MyRouter 0.0.0.0 UG 0 0 0 em1


if someone can through me a bone, I will try to follow, since i am really newbie on Linux, i already try to find in differents forums, but no succes on my part, no "for dummys" answers :lol:

Thanks in advance for your time :-D
GuaresFST
 
Posts: 2
Joined: 2012/05/20 18:57:54

Fixed IP on boot & Default Routes

Postby pschaff » 2012/05/20 19:43:46

Welcome to the CentOS fora. Please see the recommended reading for new users linked in my signature and provide more information about your system by running "./getinfo.sh" and showing us the output file.

What is on the network to which p1p1 is connected? Why are you running the DHCP server on your CentOS system?
pschaff
Retired Moderator
 
Posts: 18277
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America

Re: Fixed IP on boot & Default Routes

Postby GuaresFST » 2012/05/20 21:10:17

p1p1 its connected on one LAN that i´m trying to give service, since the idea its to take out the modem of the ISP of the way (when i achive to configure pppoe too)

now the network is like this

INTERNET <=Dynamic IP=> ISP MODEM <=192.168.1.0/24=> CentOS <=172.20.0.0/22=> LAN

the idea is to leave whitouth the modem in the future, so for that reason i will need to keep the dhcp running on centos

INTERNET <=Dynamic IP=> CentOS <=172.20.0.0/22=> LAN

thanks for the reply
GuaresFST
 
Posts: 2
Joined: 2012/05/20 18:57:54

Re: Fixed IP on boot & Default Routes

Postby pschaff » 2012/05/21 15:09:12

The top configuration suffers from double NAT and I don't see how you expect to do away with the ISP's modem. Why not just put everything on the 192.168.1.0/24 Class C network, rather than trying to add another Class B private network?
pschaff
Retired Moderator
 
Posts: 18277
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America


Return to CentOS 6 - Networking Support

Who is online

Users browsing this forum: No registered users and 6 guests